ツリー列プラグインを使用する dgrid があります。ユーザーがツリーをクリックするたびに、サーバーを呼び出し、サブ行 (json) をキャッチしてバインドします。しかし、それが起こると、下の画像のように、これらの下位行が間違った位置に表示されます。最も奇妙なのは、ページネーションを変更すると、最初のページに戻った後、サブ行が正しい場所にとどまることです。
(私の英語を理解できるかどうか教えてください。そうすれば、テキストを改善することができます)
私の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が間違っているかもしれませんが、私はそれを特定できませんでした.
再度、感謝します。