Ext.create('Ext.data.TreeStore', {
proxy : {
type : 'ajax',
url : '...',
reader : {
type : 'json',
root : 'nodes'
}
},
root : {
expanded : true
},
autoLoad : true
});
必须指定 reader 的root属性,否则不会自动加载,当然如果指定roor:'root'也不会加载,因为root是默认值。
希望extjs能在以后的版本中改进这一设定,或者在官方文档中进行特别说明,