maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Clickable list problem

It will store all the items if you use a different key. If you use the same key it will be overwritten each time.

http://tiggzi.com/view/7bbf33e1-3238-...

Click on the first item.

This is my code:
code
alert ('About to save key1/value1 into Local Storage');
localStorage.setItem('key1', 'value1');
/code

mcgrathken.kmg
Posts: 0
Joined: Sat Feb 04, 2012 6:03 pm

Clickable list problem

Hi Max
I have tried this simply using
localStorage.setItem("key1", "value1");
localStorage["key1"] = "value1";
on the click event and it still wont work

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Clickable list problem

Did you check with Chrome Developer Tools that the value is not there?

Image

mcgrathken.kmg
Posts: 0
Joined: Sat Feb 04, 2012 6:03 pm

Clickable list problem

yes i can get this but it wont add the clicked item to localstorage

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Clickable list problem

Which part exactly can you get?

mcgrathken.kmg
Posts: 0
Joined: Sat Feb 04, 2012 6:03 pm

Clickable list problem

i can get the same as in your screenshot above.
i'm trying to add each clicked item to a list to localstorage

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Clickable list problem

When you render the list you need to store the item label, then on click get the value and store it in Local Storage. Almost the same thing is done here: http://help.gotiggr.com/getting-start...

mcgrathken.kmg
Posts: 0
Joined: Sat Feb 04, 2012 6:03 pm

Clickable list problem

yes but surely i dont need a second label to just store the item in local storage.
It is not required on a different page.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Clickable list problem

You don't, you can just read off the label shown.

Return to “Issues”