我有一個網格用ajax填充,用戶輸入新數據並回調到填充網格的ajax方法,我遇到的問題是網格是重複數據,我已經升級前柵格試圖填補一個空白strore但不工作,如何清除dojox.grid.DataGrid來更新網格
var gridColeccion = dijit.byId("colectionGrid");
var dummy = {items: []};
var newEventStoreColeccion = new dojo.data.ItemFileReadStore({clearOnClose:true,data:dummy});
newEventStoreColeccion.fetch();
gridColeccion.setStore(newEventStoreColeccion);
gridColeccion._refresh();
folderConsult(token); // This metod fill the grid again
//這是在folderConsult代碼的一部分;
var datosColeccion = {
items: itemsColeccion
};
var gridColecccion = dijit.byId("colectionGrid");
nuevasColecciones= new dojo.data.ItemFileReadStore({clearOnClose:true,data: datosColeccion});
nuevasColecciones.fetch();
gridColecccion.setStore(nuevasColecciones);
gridColecccion._refresh();
我希望有人能幫助我,THX。