To change the values ββin the grid, you will need to change the value in the grid store. Grid data is tied to storage data, and the grid will be updated as needed.
So, the key is to understand Dojo api data and how stores work in Dojo. Instead of manipulating data directly in the grid, manipulate it in storage.
Ideally, storage is your array that you manipulate when you start the application, and you will not need to synchronize the array with the grid. Just use ItemFileWriteStore as the owner of the data if this is not possible.
In addition, using the Dojo api data identifier makes it easier to find items in the grid, if possible. Assuming that you know when an item is updated, deleted, or changed in your application, you should be able to modify the grid store as needed when an action occurs. This is definitely the preferred approach. If you cannot do this, you will have to make a general choice and use the onComplete callback to manually synchronize your arrays, which will be very slow and will not scale well, in which case you can just create a new store all together and assign it to the grid with grid.setStore (myNewStore)
Here is the fiddle with the basic operations create, update and delete: http://jsfiddle.net/BC7yT/11/
In these examples, all are used to declare an identifier when creating a repository.
var store = new dojo.data.ItemFileWriteStore({ data: { identifier : 'planet', items: itemList } });
UPDATING THE CURRENT ITEM:
//If the store is not in your scope you can get it from the grid var store = grid.store; //fetchItemByIdentity would be faster here, but this uses query just to show //it is also possible store.fetch({query : {planet : 'Zoron'}, onItem : function (item ) { var humans = store.getValue(item, 'humanPop'); humans += 200; store.setValue(item, 'humanPop', humans); } });
INSERT A NEW ITEM:
store.newItem({planet: 'Endron', humanPop : 40000, alienPop : 9000}); } catch (e) {
REMOVE ITEM:
store.fetchItemByIdentity({ 'identity' : 'Gaxula', onItem : function (item ) { if(item == null) {