Hi,
I have a service where I created a modelstorage and the selectmenu is comming on the screen as undefined.
I am including some screenshots it may help to discover what mistake I have made.
Here is the collection,
modelstorage,
mapping to localstorage
result in localstorage,
mapping to page, the js used in mapping for selectmenu and the result is undefined, the mapping js is from the old builder, without the js nothing shows on the screen.
Does this js need to be altered for the new builder?
Or is ther something else wrong with this setup?
there are no errors in console
If theres anything else I can show you please ask
thanks
js used in mapping to selectmenu
codefunction strRepresentationToObject(str) {
str = str.slice(1, -1);
var i, len, obj={}, tmp, arr = str.split(', ');
for (i = 0, len = arr.length; i < len; i++) {
tmp = arr.split('=');
obj[tmp[0]] = tmp[1];
}
return obj;
}
var valuesArray;
try {
valuesArray = JSON.parse(value);
if ({}.toString.call(valuesArray) !== "[object Array]") {
valuesArray = [];
}
} catch ( e ) {
valuesArray = [];
}
var i, len, obj, $element = $(element);
$element.empty();
for (var i = 0, len = value.length; i < len; i++) {
obj =strRepresentationToObject(value);
$element.append('<option rerender="chickenpizzaselectmenu" value="' + obj['price'] + '">' + obj['size'] + '</option>');
}
return true;/code