var rc_store = new Ext.data.SimpleStore( {
fields : [ 'value', 'text' ],
data : [ [ '10', '行' ], [ '20', '列' ] ]
});
var bar_v= [ {
text:'展开',
handler:function(){
tree.expandAll();
}
},'-',{
text:'折叠',
handler:function(){
tree.collapseAll();
tree.root.expand();
}
},'-',{
xtype : 'combo',
name : 's001_name',
id : 's001',
triggerAction : 'all',
mode : 'local',
emptyText : '请选择',
store : rc_store,
hiddenName : 's001_name',
valueField : 'value',
displayField : 'text',
listeners : {
select : function(combo, record, index) {
console.log(record);
alert(index);
}
}
},{text:'编辑',
handler:function(btn){
alert(btn.text);
}
}
];
//加载地址
var ld_v=new Tree.TreeLoader( {
dataUrl :'Action.do? '
});
//监听
var lt_v={"contextmenu":function(node,event){
}};
var tree = new Tree.TreePanel( {
id : 'group-type',
el : 'tree-div-type',
split:false,
width: 300,
//minSize: 164,
//maxSize: 164,
//height:240,
rootVisible: false,
autoScroll : true,
animate : true,
tbar:bar_v,
border:false,
enableDD : false,
containerScroll : true,
loader : ld_v,
listeners: lt_v
});
var root = new Tree.AsyncTreeNode( {
text : '',
iconCls : '',
draggable : false,
id : '-1'
});
tree.setRootNode(root);
tree.render();
root.expand();