The above answers are correct, but you also need to call save() in the record store to βcommitβ the change. When you save, the widget using storage (e.g. datagrid) will update.
In addition, newItem() returns the new element that you just created, so if you do not want to pass the object to newItem , just change its return value, then save() store.
Pseudocode:
var i = store.newItem({}); store.setValue(i,"newattribute1","new value"); store.setValue(i,"newattribute2","new value 2"); store.save();
Here are the relevant docs for ItemFileWriteStore that explains how to use newItem() , setValue() and save() .
Instead of deleteItem you should use setStore(new ItemFileWriteStore()) , but I suspect there is a memory leak when you do this, be careful. This makes a new empty store for use with the net.
srock source share