我有一個dgrid,使用樹列插件。每次用戶點擊樹時,我都會調用服務器,捕獲子箭頭(json)並綁定它。但是當它發生時,這些子箭頭就會顯示在錯誤的位置上,就像圖像波紋管一樣。最奇怪的是當我改變分頁時,在返回到第一頁之後,這些亞行保持在正確的位置上。道場dgrid樹,錯位的亞行
(請告訴我,如果可以理解我的英語水平,那我可以嘗試提高文本)
我dgrid代碼:
var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, Pagination]);
var grid = new CustomGrid({
columns: [
selector({label: "#", disabled: function(object){ return object.type == 'DOCx'; }}, "radio"),
{label:'Id', field:'id', sortable: false},
tree({label: "Title", field:"title", sortable: true, indentWidth:20, allowDuplicates:true}),
//{label:'Title', field:'title', sortable: false},
{label:'Count', field:'count', sortable: false}
],
store: this.memoryStore,
collapseOnRefresh:true,
pagingLinks: false,
pagingTextBox: true,
firstLastArrows: true,
pageSizeOptions: [10, 15, 25],
selectionMode: "single", // for Selection; only select a single row at a time
cellNavigation: false // for Keyboard; allow only row-level keyboard navigation
}, "grid");
我的內存存儲:
loadMemoryStore: function(items){
this.memoryStore = Observable(new Memory({
data: items,
getChildren: function(parent, options){
return this.query({parent: parent.id}, options);
},
mayHaveChildren: function(parent){
return (parent.count != 0) && (parent.type != 'DOC');
}
}));
},
這一刻我綁定了子箭頭:
success: function(data){
for(var i=0; i<data.report.length; i++){
this.memoryStore.put({id:data.report[i].id, title:data.report[i].created, type:'DOC', parent:this.designId});
}
},
我在想,也許每一個時刻我都綁定了這些子行,我可以像在網格上刷新一樣,也許可以工作。我認爲分頁功能是一樣的。
謝謝。
編輯:
我忘了問題。那麼,我該如何糾正這個錯誤?如果在dgrid刷新工作。我該怎麼做?我想的其他事情,也許我的getChildren是錯誤的,但我無法識別它。
再次感謝。
我想,但沒有成功做到這一點的工作。我無法相信沒有人會有這樣的例子。加載網格之前,所有這裏都加載你的子步驟? 如果您在用戶選擇後加載子項目,則可獲得更多性能。 沒人? – Ventura