pritu patel
Posts: 0
Joined: Tue Jan 21, 2014 6:24 am

Counter value from list

I want counter value from listitem and store it in local sotrage variable .how to retrive it??

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

Counter value from list

Hi Pritu,

Do you want to calculate a number of list items? Do you generate them using a service?

pritu patel
Posts: 0
Joined: Tue Jan 21, 2014 6:24 am

Counter value from list

yes!! i create a list using service..

I want to get counter value in local storage varible

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

Counter value from list

Pritu,

If your service returns an array, add this JavaScript handler on service Success event:prelocalStorage.setItem("count", data.length);/preThis code saves an array length in a localStorage variable 'count'.

If the service returns an array inside of another object (for example 'obj'), you can use:predata.obj.length/pre

pritu patel
Posts: 0
Joined: Tue Jan 21, 2014 6:24 am

Counter value from list

thnks!! for your reply

Return to “Issues”