'Users'
]
extend:'Ext.app.Controller',
requires:['Ext.window.MessageBox'],//這句不加下面的Ext.Msg.alert會出錯!
this.control({
'treepanel':{
itemclick:function(view,record){
Ext.Msg.alert('你點擊了',record.get('text'));//打印樹節點的名字
},
e.preventDefault(); //阻止瀏覽器事件
e.stopEvent(); //阻止瀏覽器事件
var nodemenu=new Ext.menu.Menu({
floating:true,
items:[{
text:"新增組織機構",
icon:'images/add.gif',
iconCls:'leaf',
handler:function(){
alert("新增");
}
},{
text:"編輯組織機構",
icon:'images/leaf.gif',
iconCls:'leaf',
handler:function(){
alert("編輯");
}
},{
text:"刪除組織機構",
icon:'images/delete.gif',
iconCls:'leaf',
handler:function(){
alert("刪除");
}
}]
});
nodemenu.showAt(e.getXY());//顯示在鼠標的位置
}
},
}
);
}
});