|
<script type="text/javascript">
F.ready(function () {
var treeClientID = '<%= Tree1.ClientID %>';//树的id
var tree = F(treeClientID);
tree.on("itemcontextmenu", function(view, record, item, index, e) {
//node.select();
//alert(node.id);
e.preventDefault();
e.stopEvent();
var treeMenu = new Ext.menu.Menu({
floating: true,
items:[
{
cls: "x-btn-text-icon",
text: "展开",
icon: "./res.axd?icon=webcam.png",
pressed: true,
handler: function() {
//当点击时隐藏右键菜单
//this.up("treeMenu").hide();
//alert(record.raw.name);
var roottext = record.data.text;
var rootId = record.getId();
alert(rootId);
}
},
{ cls: "x-btn-text-icon", text: "收缩", icon: "./res.axd?icon=webcam.png", pressed: true, handler: function() { node.collapse(true, true) } },
{ cls: "x-btn-text-icon", text: "添加", icon: "./res.axd?icon=webcam.png", pressed: true },
{ cls: "x-btn-text-icon", text: "上移", icon: "./res.axd?icon=webcam.png", pressed: true },
{ cls: "x-btn-text-icon", text: "下移", icon: "./res.axd?icon=webcam.png", pressed: true },
{ cls: "x-btn-text-icon", text: "删除", icon: "./res.axd?icon=webcam.png", pressed: true }
]
});
//定位菜单的显示位置
treeMenu.showAt(e.getXY());
});
})
</script>
|
|