Page 2 of 2

edit and re-save item

Posted: Mon Apr 09, 2012 12:41 pm
by emmamcconnell37

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


edit and re-save item

Posted: Mon Apr 09, 2012 1:05 pm
by maxkatz

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


edit and re-save item

Posted: Mon Apr 09, 2012 1:14 pm
by emmamcconnell37

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


edit and re-save item

Posted: Mon Apr 09, 2012 1:44 pm
by maxkatz

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


edit and re-save item

Posted: Mon Apr 09, 2012 2:17 pm
by emmamcconnell37

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


edit and re-save item

Posted: Tue Apr 10, 2012 3:37 pm
by Amarok

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.


edit and re-save item

Posted: Tue Apr 10, 2012 6:10 pm
by maxkatz

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


edit and re-save item

Posted: Wed Apr 11, 2012 1:32 am
by Amarok

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


edit and re-save item

Posted: Fri Nov 09, 2012 5:24 pm
by RichardGolko

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.