Ext.define('ctreemodel', {
extend: 'Ext.data.Model',
fields: [
{name: 'aa', type: 'string'},
{name: 'text', type: 'string'}
....
]
});
Ext.create('Ext.tree.Panel',{
title: 'Tree test',
contentEl:'tree-div',
autoScroll:true,
minWidth: 135,
maxWidth: 200,
store : Ext.create('Ext.data.TreeStore', {
model: 'ctreemodel',
root : {
text: 'Tree Node',
expanded : true,
children : [ {
text : "detention",
aa:'bb',
leaf : true
}, {
text : "homework",
expanded : true,
children : [ {
text : "book report",
leaf : true
}, {
text : "alegrbra",
leaf : true
} ]
}, {
text : "buy lottery tickets",
leaf : true
} ]
}
}),
listeners : {
'itemclick' : function(view,re){
alert(re.data.aa);
}
}
});
ext4 tree单击事件
最新推荐文章于 2017-10-08 15:29:29 发布