我在ExtJS庫中找到了一個很好的TreeGrid控件。但有一件事,我有非常大的樹,我需要按需加載。有沒有人知道如何在ExtJS TreeGrid中按需加載數據?
有沒有人知道如何在ExtJS TreeGrid中按需加載數據?
我的代碼是在這裏:
Ext.onReady(function() {
Ext.QuickTips.init();
var tree = new Ext.ux.tree.TreeGrid({
title: 'Encyclopedia',
width: 400,
height: 500,
animate: true,
autoScroll: true,
renderTo: "EncyclopediaTree",
containerScroll: false,
border: false,
enableDD: false,
root : new Ext.tree.AsyncTreeNode({text: 'Root'}),
loader: new Ext.tree.TreeLoader({ dataUrl: '/AdminEx/GetEncyclopediaTree' }),
columns: [{
header: 'Item',
dataIndex: 'item',
width: 230
}, {
header: 'Type',
width: 150,
dataIndex: 'type'
}]
});
});
後用JSON一起更新的代碼,你從服務器接收回:這將異步當你在文件夾上單擊
雖然這不會異步加載加載 – SBUJOLD 2010-09-01 13:00:23