Page 1 of 2

edit and re-save item

Posted: Fri Apr 06, 2012 5:15 pm
by emmamcconnell37

Hello
Can you please tell me how to edit an item in a list an re-save into local storage
Thank you


edit and re-save item

Posted: Fri Apr 06, 2012 7:43 pm
by maxkatz

It can be done with JavaScript.. but can you provide more details what exactly you want to change and what saved into Local Storage?


edit and re-save item

Posted: Fri Apr 06, 2012 8:20 pm
by emmamcconnell37

Hello Max
i'm only new and just trying out Tiggzi but it looks promising.Does Tiggzi have the same power as offered in a standalone environment?
I just need a basic app to learn the basics.
I was hoping to make a simple todo list which would help many busy parents i know.
It doesn't need to connect externally but simply use localstorage and to be able add, edit and delete from a simple list which i have created.
I haven't added any javaScript yet but i was just playing around with Tiggzi environment and trying to become familiar.I see you can custom javascript to a component which is nice.I have tried the simpler tutorials so i have an idea how Tiggzi works.
I have only created the list named "todolist"

Image

sorry if this seems trivial please excuse as i am only learning.
would i have to use the grid and put an add/delete buttton on each item (bit messy)
or could i add say for delete, an image of a cross or pencil for edit and on click event of the image to perform appropriate action ?
maybe using jQuery or something ?
Thank you Max


edit and re-save item

Posted: Fri Apr 06, 2012 8:39 pm
by maxkatz

[quote:]
or could i add say for delete, an image of a cross or pencil for edit and on click event of the image to perform appropriate action ?
[/quote]
Yes, you can use images for these actions and then add click event.

In general, to build an app like this you would need to write custom JavaScript - for adding and deleting items from the list and into Local Storage.


edit and re-save item

Posted: Fri Apr 06, 2012 9:05 pm
by emmamcconnell37

I have done this in html using
$(function (){
// store content
var todo = document.getElementById('todo');
$("#todo").blur(function() {
localStorage.setItem('todoData', this.innerHTML);
});

how can i do this in Tiggzi using javascript


edit and re-save item

Posted: Fri Apr 06, 2012 10:13 pm
by maxkatz

edit and re-save item

Posted: Sat Apr 07, 2012 1:31 am
by emmamcconnell37

thanks Max
I had a look at the JavaScript API Tiggr.Storage()
Creates a new storage
storage[key] = value;
Why is it called Tiggr ?
So if i want to save or edit a to-do item what javascript will do this as i'm a bit confused because there is also a set local storage varible option which i could map to the list ?


edit and re-save item

Posted: Sat Apr 07, 2012 6:19 pm
by maxkatz

Tiggr is our old name. We will update the API soon but the old one will still work. If you wan to use any Local Storage API, just use browser's getItem/setItem (and others) directly, without the Tiggr function.


edit and re-save item

Posted: Sun Apr 08, 2012 1:48 am
by emmamcconnell37

ok i got Max thanks.
Just another ques.
Can you please show me some javascript so i can edit an item in localstorage.
Thanks Max.
When are Exadel planning next release version as i think some more interactive non javascript,jquery features on components would be awesome.Obviously javascript, jquery in background but just hidden from user to make more user friendly.Just a suggestion.Anyway, hope you release soon guys as i'm only on trial and hope to stay to using Tiggzi.


edit and re-save item

Posted: Sun Apr 08, 2012 6:05 pm
by maxkatz

There are two main methods:
localStorage.setItem(key, value);
localStorage.getItem(key);

https://developer.mozilla.org/en/DOM/...