I have the below code to query a SQLite database when the app is offline.
The results JS variable is an array of records.
I want to take "window.App.RootScope.dailyCrews = results;" and set "dailyCrews" to the NewArray "arrDailyCrews".
Is that needed or can I just use "window.App.RootScope.dailyCrews" as my array on the AB code side?
Hello Ryan,
If I am understand well, what you asked is if the NewArray action is required. If so, in principle, it's not required, that is, you can create the Array variable just by assigning the "result" variable into "window.App.RootScope.dailyCrews", just like you do now.
However, certainly in some situations we need to declare a variable before can use it, for example, inside app functions. So maybe it's not a bad idea to use the "NewArray" action in the app Ready event, or the app view Show event.
Thank you David
If I do decide to use NewArray "arrDailyCrews" do I need to loop "window.App.RootScope.dailyCrews" to fill the new array or is it just a direct assignment?
Hello Ryan,
Talking about Javascript, you can directly assign the new array variable into the other without problems.
Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.