开发者

Dojo grid update from store

I have a dojox.grid.DataGrid working with a dojox.data.JsonRestStore. After changing values of one cell (let's call it cell A1) trough AJAX, I reload the Grid like this :

dijit.byId('reminders').selection.clear();
dijit.byId('reminders').store._items = Array();
dijit.byId('reminders')._refresh();

and everything works ok. However, if a change the value of another cell (cell A2) on the same row, without reloading the whole grid, like this :

var grid = dijit.byId('reminders');
var item = grid.getItem(parseInt(response_data.edit_row));
grid.store.setValue(item, 'rem_text', response_data.rem_text);

when I change the value of cell A1 and reload the grid the value shown doesn't change even though the value in the response is changed (seen in Firebug console).

This is the only case when this happens. If I change the开发者_StackOverflow中文版 value of B2 and then A1 and reload it works ok. So, after editing, I get the new store with the correct values, but it doesn't show. I hope I was clear enough explaining

I don't know what I'm missing here, especially because the code works in all other cases. Any insight would be greatly appreciated.


I had some problems with the JsonRestStore and ended up using a QueryReadStore, which retrieved my data the way I wanted and worked with grid._refresh.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜