Page 2 of 2

code error

Posted: Fri Oct 25, 2013 2:16 am
by Igor

There is issue with calling save() function. You try to get values from not existing components.
After successful service call, components name has index with name.

pre
Appery("chickenpizza_item_label_1")
Appery("chickenpizza_item_label_2")
...
Appery("chickenpizza_item_label_n")
/pre


code error

Posted: Fri Oct 25, 2013 2:26 am
by Michael4771079

I'm sorry Igor,
I don't follow


code error

Posted: Fri Oct 25, 2013 7:32 am
by Maryna Brodina

Hello! You have the same problem described here https://getsatisfaction.com/apperyio/.... Try the following code:
pre$grid = $(this).closest("[name=chickenpizzamobilegrid]");
save({'Pizza':$grid.find("[name=chickenpizza_item_label]").text(), 'Size':$grid.find("[name=orderlabel]").text(),
'Base':$grid.find("[name=thin_deeptoggle]").val(),
'Price':$grid.find("[name=chickenpizzaPricelabel]").text()},
"liveoderArray");/pre
By the way this code
prevar arr = JSON.parse(localStorage.getItem(varName));
if(arr == null) {
arr = new Array();
}/pre in save and myload functions is not correct too. Please replace it with the following one:
pretry {
var arr = JSON.parse(localStorage.getItem(varName));
if ({}.toString.call(arr) !== "[object Array]") {
arr = [];
}
} catch ( e ) {
arr = [];
}/pre


code error

Posted: Fri Oct 25, 2013 10:43 am
by Michael4771079

Thanks Marina,

just to check, this code you posted earlier, is it in addition to, or instead of the code below, that I was using onclick

code$grid = $(this).closest("[name=chickenpizzamobilegrid]");
save({'Pizza':$grid.find("[name=chickenpizza_item_label]").text(), 'Size':$grid.find("[name=orderlabel]").text(),
'Base':$grid.find("[name=thin_deeptoggle]").val(),
'Price':$grid.find("[name=chickenpizzaPricelabel]").text()},
"liveoderArray");/code

codesave(
{'Pizza':Tiggzi("chickenpizza_item_label").val(), 'Size':Tiggzi("orderlabel").val(),
'Base':Tiggzi("thin_deeptoggle").val(),
'Price':Tiggzi("chickenpizzaPricelabel").val()},
"liveoderArray");/code


code error

Posted: Fri Oct 25, 2013 11:14 am
by Maryna Brodina

Instead


code error

Posted: Fri Oct 25, 2013 12:41 pm
by Michael4771079

Cheers Marina,
all good now,