Extjs示例中的静态加载如何换为动态加载?

oksonic oksonic 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Extjs有这样一个例子,下面是加载数据代码,但这里使用的是静态数据,我想换为动态加载,但不知道怎么办。
ApiPanel = function() {
ApiPanel.superclass.constructor.call(this, {
id:'api-tree',
region:'west',
split:true,
header: false,
width: 280,
minSize: 175,
maxSize: 500,
collapsible: true,
margins:'0 0 5 5',
cmargins:'0 0 0 0',
rootVisible:true,
lines:false,
autoScroll:true,
animCollapse:false,
animate: false,
collapseMode:'mini',
loader: new Ext.tree.TreeLoader({
preloadChildren: true,
clearOnLoad: false
}),
root: new Ext.tree.AsyncTreeNode({
text:'ROOT',
id:'root',
expanded:true,
children:[Docs.classData]

}),
collapseFirst:false
});
// no longer needed!
//new Ext.tree.TreeSorter(this, {folderSort:true,leafAttr:'isClass'});

this.getSelectionModel().on('beforeselect', function(sm, node) {
return node.isLeaf();
});
};
...全文
评论 4
收藏 已收藏
分享
返回顶部
oksonic
JavaScript 87,984 成员 224,681 内容