Page 1 of 6

js not working since upgrade

Posted: Thu Jan 22, 2015 10:50 am
by Michael4771079

Any idea why this code to save values to lsv array doesnt work in new builder,
worked perfect in old builder.
All component names are correct, and no errors in console

$grid = $(this).closest("[name=mobilegrid_1_3]");
save({'Item':$grid.find("[name=sundrieslabel_55]").text(),
'Price':$grid.find("[name=costlabel_58]").text()},
"livesundriesorderArray");


js not working since upgrade

Posted: Thu Jan 22, 2015 11:21 am
by Illya Stepanov

Hi Michael -

Most of components was optimized or changed due to structured, new mapping, and other features.
You need to debug your custom JavaScript code.


js not working since upgrade

Posted: Thu Jan 22, 2015 11:31 am
by Michael4771079

lllya,
I have 2 clients screaming at me at the momnent over this app.
this code worked perfectly in old builder. I didnt break it!
There are no errors in the console.

I dont know what you have changed in the structure, I need to know what to change in the js.
This js is used all over my app, on every page.
this app is in the app store and we cant upgrade due to these errors.

I have already built this app once, I never expected to have to pratically rebuild because of an upgrade.

Please provide an example of how the js should be written.

thank you


js not working since upgrade

Posted: Thu Jan 22, 2015 9:51 pm
by Michael4771079

Hi,
is there any chance of an update here, I didnt understand lllya's comment,
as regards to debugging there are no errors in console.
How can I fix this code?


js not working since upgrade

Posted: Thu Jan 22, 2015 9:57 pm
by Evgene Karachevtsev

Hello Michael,

Sorry for misunderstanding, could you please try to debug your app to find out where there is the error? http://devcenter.appery.io/documentat...


js not working since upgrade

Posted: Thu Jan 22, 2015 10:08 pm
by Michael4771079

Thanks Evegene,
there is no error, when I click the order button nothing happens in localstorage, console or network, in previous builder it saved all label values to an array in local storage.
While I understand some js is outside of your scope of support this is an already published app.but the upgrade has broken this event.

Thanks again
Michael


js not working since upgrade

Posted: Fri Jan 23, 2015 1:38 pm
by Michael4771079

Is there any chance of some help fixing the code in my app


js not working since upgrade

Posted: Fri Jan 23, 2015 2:22 pm
by Alena Prykhodko

Hello Michael,

Please provide us with a public app link (http://devcenter.appery.io/documentat...) and steps to reproduce.


js not working since upgrade

Posted: Fri Jan 23, 2015 2:52 pm
by Michael4771079

Thank you Alena,
app name is "anglo pizza" fb9a304e-0de6-43ad-9107-2599e01bc76c
and is shared

open app and login use "a" as login and pass,
click new order button,
from menu click item9,
on sundries page click collapsible and then click order,
the following code is run on click of order button and the details of the labels in the collapsible should be saved in localstorage "livesundriesorderArray"

code$grid = $(this).closest("[name=mobilegrid_1_3]");
save({'Item':$grid.find("[name=sundrieslabel_55]").text(),
'Price':$grid.find("[name=costlabel_58]").text()},
"livesundriesorderArray"); /code

thanks again Alena, much appreciated!


js not working since upgrade

Posted: Fri Jan 23, 2015 6:36 pm
by Michael4771079

Update
I had forgotten about this static js in the app

codefunction save(item, varName) {
try {
var arr = JSON.parse(localStorage.getItem(varName));
if ({}.toString.call(arr) !== "[object Array]") {
arr = [];
}
} catch ( e ) {
arr = [];
}
arr.push(item);
localStorage.setItem(varName, JSON.stringify(arr));
}

function myload(varName) {
try {
var arr = JSON.parse(localStorage.getItem(varName));
if ({}.toString.call(arr) !== "[object Array]") {
arr = [];
}
} catch ( e ) {
arr = [];
}
}
/code