Ext.data.TreeStore
Ext.define('Tree', {
extend: 'Ext.data.Model',
fields: [
{name: 'rw_id', type: 'string'},
{name: 'rw_name', type: 'string'},
{name: 'id', type: 'string'},
{name: 'parentid', type: 'string'},
{name: 'leaf', type: 'boolean'},
{name: 'rw_mustdata', type: 'string'},
{name: 'rw_sfwcname', type: 'string'}
]
});
var store = Ext.create('Ext.data.TreeStore',{
model: 'Tree',
proxy : {
type : "ajax", //获取方式
url : url //获取树节点的地址
}
}).load();
加载出来数据不显示
到底是TreeStore,出问题了还是?
//java类是这样写的,用的struts2
public class Tree {
private String id;
private String parentid;
private String rw_id;
private String rw_name;
private Boolean leaf;
private String rw_mustdata;
private String rw_sfwcname;
}
很急,求解释
------解决方案--------------------TreeStore中加上
root : {
expanded : true
},
autoLoad : true