Ananya Raju
Posts: 0
Joined: Tue Oct 01, 2013 8:04 am

Lists

Hello,
In My App i am CReating a input Box which accepts all the values entered by the user and then Store all those values which is entered by the user in the form of a array in another local storage....

all the values that the user enters are already getting stored into a localstorage...called L1
so could u pls Help me out with a Js that would do the above...
I want a LocalStorage called L2 To contain all the information a user entered ie take the info from L1 in store it in a array in L2 ...pls help me out with the corresponding Js

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Lists

Hi Ananya,

You can use the following code:
code// retrieve stored data (JSON stringified) and convert
storedData = localStorage.getItem("L2");
ArrayData = (storedData) ? JSON.parse(storedData) : [];
ArrayData[ArrayData.length] = localStorage.getItem("L1");
// store array to localstorage
localStorage.setItem("L2", JSON.stringify(ArrayData));/code

Ananya Raju
Posts: 0
Joined: Tue Oct 01, 2013 8:04 am

Lists

Thank You that works perfectly... now i would like to display all the array data one by one in a list ...wen a user enters data in a inputbox and clicks the + button it has to simultaneously be updated into the list(the list contains a label)

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Lists

Hi Ananya,

Do you use Appery.io "mobilelist" component or want to use your custom component?

Ankush Ak
Posts: 0
Joined: Mon Aug 05, 2013 10:26 am

Lists

i am using Appery.io "mobilelist" component

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Lists

Hi,

You can create GenericService with the following process function:
codeprocess : function(settings) { settings.success({"value":localStorage.getItem("L2")});
}/code
Add one more Response parameter "value", tick it as an array.
Now it can be mapped as an usual REST Service: http://docs.appery.io/documentation/u...

Return to “Issues”