您现在的位置是:首页 > 电脑技术查询 > web开发

extjs4 如何实现动态加载树

编辑:chaxungu时间:2022-10-02 23:16:43分类:web开发

extjs4 怎么实现动态加载树
extjs4 怎么实现动态加载树 我点击一个节点 传一个id 到数据库查询下面子节点数据高手指点下!!!

------解决方案--------------------
Ext.onReady(function () {
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'data.htm'
},
root: {
text: 'Ext JS',
id: 'id'
}


});

var tree = Ext.create('Ext.tree.Panel', {
id: 'tree',
store: store,
width: 250,
height: 300,
renderTo: document.body
});


});
------解决方案--------------------
JScript code Ext.onReady(function () { var store = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', url: 'data.htm' }, root: { text: 'Ext JS', id: 'id' } }); var tree = Ext.create('Ext.tree.Panel', { id: 'tree', store: store, width: 250, height: 300, renderTo: document.body }); });