Treeview上的上下文菜单

Treeview上的上下文菜单

本文介绍了Treeview上的上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

是否有人成功在任何Web项目的树视图上实现了特定于节点的上下文菜单?

我已经在特定的treenode上填充了上下文菜单,并且能够获取treenode标记名,但是当我右键单击treenode时,我无法选择树节点.

我的代码如下:

Hi All,

Has anyone successfully implemented a node specific context menu on a treeview in any web project?

I have populated context menu on specific treenode and able to get the treenode tagname, but i am not able to select the tree node while i right click on the treenode.

My code is as follows:

function ShowContextMenu()
        {
            var obj = window.event.srcElement;
            if(obj.tagName == "SPAN")
            {
                showhide(''ctl00_menuHover'',''true'',obj.tagName);//function to show/hide menu
            }
        }





<asp:treeview id="trvMenu" runat="server" datasourceid="SiteMapDataSource1" xmlns:asp="#unknown">
                                    CollapseImageToolTip="Collapse" ExpandImageToolTip="Expand"
                                    ShowLines="True" oncontextmenu="Javascript:ShowContextMenu();return false;">
                                </asp:treeview>



右键单击时,有人可以帮我显示选定的节点吗?

问候,
Snigdha



Can somebody help me show the node as selected when i do right click?

Regards,
Snigdha

推荐答案


这篇关于Treeview上的上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 10:30