|
<script type="text/javascript">
function onReady() {
var treeClientID = '<%= DeviceTree.ClientID %>';//树的id
var tree = X(treeClientID);
tree.on("contextmenu", function (node, e) {
//node.select();
//alert(node.id);
e.preventDefault();
var treeMenu = new Ext.menu.Menu
([
{ cls: "x-btn-text-icon", text: "展开", icon: "./res.axd?icon=webcam.png", pressed: true, handler: function () { node.expand(true, false) } },
{ 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.getPoint());
});
}
</script>
|
|