FineUI 官方论坛
标题:
FineUI 4.0 树实现右键菜单
[打印本页]
作者:
Hanson
时间:
2014-4-10 14:21
标题:
FineUI 4.0 树实现右键菜单
<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>
作者:
猪八戒
时间:
2014-4-10 23:41
能不能做成DOME给大家看看!菜单事件要怎么写呢?
作者:
liaofeifan
时间:
2014-4-22 07:20
强烈建议弄个demo!!!
作者:
yezie
时间:
2015-4-25 17:09
这好复杂,demo里现在都没有
欢迎光临 FineUI 官方论坛 (https://www.fineui.com/BBS/)
Powered by Discuz! X3.4