Extjs整体加载树节点
Ext.onReady(function () {
Ext.define('company', {
extend: 'Ext.data.Model',
fields: ['text']
});
var treeStore1 = Ext.create('Ext.data.TreeStore', {
model: 'company',
proxy: {
type: 'ajax',
url: 'Handler6.ashx',
//reader: 'json'
}
});
Ext.create('Ext.tree.Panel', {
title: '分级加载树节点',
renderTo: Ext.getBody(),
width: 500,
height: 350,
store: treeStore1,
// root:{text:'树根'},
rootVisible:false,//root可有可无,但是这个配置项必须有,否则树结构无法显示。WHY???
useArrows:true,
columns: [
{ xtype: 'treecolumn', text: '名称', dataIndex: 'text', sortable: true}
]
});
});
Ext.define('company', {
extend: 'Ext.data.Model',
fields: ['text']
});
var treeStore1 = Ext.create('Ext.data.TreeStore', {
model: 'company',
proxy: {
type: 'ajax',
url: 'Handler6.ashx',
//reader: 'json'
}
});
Ext.create('Ext.tree.Panel', {
title: '分级加载树节点',
renderTo: Ext.getBody(),
width: 500,
height: 350,
store: treeStore1,
// root:{text:'树根'},
rootVisible:false,//root可有可无,但是这个配置项必须有,否则树结构无法显示。WHY???
useArrows:true,
columns: [
{ xtype: 'treecolumn', text: '名称', dataIndex: 'text', sortable: true}
]
});
});