2
有沒有人知道在EditorGridPanel中移動行的工作示例(或知道爲什麼它不適合我)? 我發現幾個例子,和那些我發現使用這種方法:在EditorGridPanel中上下移動行
// calculate the new index, then remove the record from the store, and re-insert it at the new index
grid.getStore().remove(record);
grid.getStore().insert(index, record);
在我的情況下失敗。它在網格中看起來不錯,但實際上2個DELETE http請求被髮送到服務器,並且沒有PUT。這在我重新加載頁面時變得明顯 - 移動的行實際上已被刪除。
He're我店的基本配置:
var remoteJsonStore = new Ext.data.JsonStore({
storeId: 'colStore',
autoDestroy: false,
autoSave: true,
proxy: new Ext.data.HttpProxy({url:'/exercises/collect/data_rows'}),
restful: true,
format: 'json',
disableCaching: false,
autoLoad: true,
writer: new Ext.data.JsonWriter({
encode: false
}),
root: 'data',
idProperty: 'data_row_id',
fields: recordFields,
baseParams:{section_id:GridUtils.properties[gridId]['section_id']},
listeners:{
exception:function(misc){
// stuff....
},
beforewrite:function(store, action, rs, options, arg){
this.baseParams["position"]=rs.rowIndex;
},
beforesave:function(store, data){
// stuff.... }
}
}
});