Page 1 of 1

Counter value from list

Posted: Fri Jan 24, 2014 5:53 am
by pritu patel

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


Counter value from list

Posted: Fri Jan 24, 2014 7:50 am
by Kateryna Grynko

Hi Pritu,

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


Counter value from list

Posted: Fri Jan 24, 2014 8:41 am
by pritu patel

yes!! i create a list using service..

I want to get counter value in local storage varible


Counter value from list

Posted: Fri Jan 24, 2014 11:36 am
by Kateryna Grynko

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


Counter value from list

Posted: Fri Jan 24, 2014 11:45 am
by pritu patel

thnks!! for your reply