Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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");

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

js not working since upgrade

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.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

js not working since upgrade

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...

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

js not working since upgrade

Hello Michael,

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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!

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

js not working since upgrade

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

Return to “Issues”