emmamcconnell37
Posts: 0
Joined: Fri Apr 06, 2012 5:02 pm

edit and re-save item

thanks max
I can see the clicked items in localstorage now on each click but how do i append to the list and store a Json blob

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

edit and re-save item

Do you want to store the list as a JSON blob in localstorage?

emmamcconnell37
Posts: 0
Joined: Fri Apr 06, 2012 5:02 pm

edit and re-save item

yes max please.
I dont think i need to stringify as items are text, is this a fair assumption to make max ?

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

edit and re-save item

It is text but it's not in JSON format. You would need to convert the entire list into JSON format first.

emmamcconnell37
Posts: 0
Joined: Fri Apr 06, 2012 5:02 pm

edit and re-save item

sorry max.but i have no idea how to do this.
could you give me an example please.thanks

Amarok
Posts: 0
Joined: Tue Apr 10, 2012 3:37 pm

edit and re-save item

Hi, maybe this can be of use \ help:

Save forms in cookies, local or session storage.

and this:

How to save files locally using Web Storage

If you find it useful, please share alike.
Cheers.

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

edit and re-save item

Get all the values of list into an array and then you can use this to convert to convert to JSON string:

code
var myObject = ['item1', 'item2'];
var myJSONText = JSON.stringify(myObject);
/code

http://www.json.org/js.html

Amarok
Posts: 0
Joined: Tue Apr 10, 2012 3:37 pm

edit and re-save item

Hi, thanks for your kind support. I ́m still in my early learning stages, and I ́ll try that.
Thanks!

RichardGolko
Posts: 0
Joined: Thu Oct 25, 2012 11:25 pm

edit and re-save item

Editing, re-saving and deleting items from a list is a very common and basic necessity.Too bad Tiggzi doesn't have a sophisticated grid that has this built in already, with events we can tap into like list-item-select, list-item-delete,list-item-edit and list-item-save. Also events like on-list-item-bound.

Even after reading this I have no idea how to make a list editable. I've placed edit fields above the list and want to click on an item and put the item in the edit fields.Then the item can be saved and the list reloaded. or in-line editing would be good too but then the labels displaying fields would have to change to textboxes nad checkboxes etc. Seems common but sophisticated things like this need a set of tutorials to show how to do them in detail.

Return to “Issues”