Question

I am using a Dojo Datagrid connected to a dojo.store.JsonRest through an dojo.data.ObjectStore and a dojo.store.Cache. There is also a dojo.store.Memory connected to the Cache store.

The datagrid is editable with drop-downs. The first time a value is changed, everything seems to go fine, but if you edit the same row a second time, the edit goes through to the JsonRest and to the server, but the grid itself reverts back to displaying the old value.

Is this a known bug? Any ideas for a workaround?

Was it helpful?

Solution

You could make the grid update row after saving your data to server. A callback can be like:


function onApplyCellEditHandler(inGrid, inValue, inRowIndex, inFieldIndex) {
    inGrid.yourStore.save();
    inGrid.updateRow(inRowIndex);
}

Hope it helps

OTHER TIPS

Without seeing your code it's hard to say why the changes aren't being persisted. Keep in mind that the DataGrid relies on the uniform data interface to write the changes back to the data store. Once you have edited a cell, the changes are written back through the Dojo data adapter's setValue() method; unsaved changes are stored in the adapter until you call the save() method: dataStore.save(); Once save() is called, all the changes are delivered to the object store via put() calls. The thing to keep in mind is that the grid is just displaying/reflecting the data in the store. So editing cells in the grid will not persist unless the changes have been made permanent in the underlying store(s).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top