Tree Context Menu

Right click on a node to display context menu.

  • My Documents

    • Photos
    • Program Files
      • Intel
      • Java
      • Microsoft Office
      • Games
    • index.html
    • about.html
    • welcome.html

源代码

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Tree Context Menu - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Tree Context Menu</h2>
  14. <p>Right click on a node to display context menu.</p>
  15. <div style="margin:20px 0;"></div>
  16. <div class="easyui-panel" style="padding:5px">
  17. <ul id="tt" class="easyui-tree" data-options="
  18. url: ‘tree_data1.json‘,
  19. method: ‘get‘,
  20. animate: true,
  21. onContextMenu: function(e,node){
  22. e.preventDefault();
  23. $(this).tree(‘select‘,node.target);
  24. $(‘#mm‘).menu(‘show‘,{
  25. left: e.pageX,
  26. top: e.pageY
  27. });
  28. }
  29. "></ul>
  30. </div>
  31. <div id="mm" class="easyui-menu" style="width:120px;">
  32. <div onclick="append()" data-options="iconCls:‘icon-add‘">Append</div>
  33. <div onclick="removeit()" data-options="iconCls:‘icon-remove‘">Remove</div>
  34. <div class="menu-sep"></div>
  35. <div onclick="expand()">Expand</div>
  36. <div onclick="collapse()">Collapse</div>
  37. </div>
  38. <script type="text/javascript">
  39. function append(){
  40. var t = $(‘#tt‘);
  41. var node = t.tree(‘getSelected‘);
  42. t.tree(‘append‘, {
  43. parent: (node?node.target:null),
  44. data: [{
  45. text: ‘new item1‘
  46. },{
  47. text: ‘new item2‘
  48. }]
  49. });
  50. }
  51. function removeit(){
  52. var node = $(‘#tt‘).tree(‘getSelected‘);
  53. $(‘#tt‘).tree(‘remove‘, node.target);
  54. }
  55. function collapse(){
  56. var node = $(‘#tt‘).tree(‘getSelected‘);
  57. $(‘#tt‘).tree(‘collapse‘,node.target);
  58. }
  59. function expand(){
  60. var node = $(‘#tt‘).tree(‘getSelected‘);
  61. $(‘#tt‘).tree(‘expand‘,node.target);
  62. }
  63. </script>
  64. </body>
  65. </html>
时间: 2024-10-10 00:40:51

Tree Context Menu的相关文章

sublime text 3-right click context menu

dd a system wide windows explorer button " Edit with Sublime" similar to how Notepad++ does it or some other editors?See attached screenshot. (I know this is an old thread, but since I dropped by looking for the same information and found it els

Windows context menu shortcut key

Besides the context menu key, you have another option to trigger the context menu: Shift+F10. This is especially useful when your computer/laptop (Lenovo W530) hasn't a context menu key. Reference: Lenovo W530 and the Context Menu Key

读论文 《TransForm Mapping Using Shared Decision Tree Context Clustering for HMM-based Cross-Lingual Speech Synthesis》(2)

3   Cross-lingualspeakeradaptationusing STC with a bilingual corpus 第一段: In the state mapping technique described in the previous section, the mismatch of language characteristics affects the mapping performance of transformation matrices because onl

create a C# context menu from code

I try the one of your approach, it works well in my computer. Below is my code: public void AddContextMenu() { ContextMenu mnuContextMenu = new ContextMenu(); mnuContextMenu.MenuItems.Add("&Red LED", new EventHandler(SetDisplayRed)); mnuCont

Android -- Options Menu,Context Menu,Popup Menu

Options Menu                                                                           创建选项菜单的步骤: 1.覆盖Activity 的onCreateOptionMenu(Menu menu)方法,当菜单第一次被打开时调用 2.调用Menu 的add( )方法添加菜单项(MenuItem),同时可以调用MenuItem 的setIcon( )方法来为菜单项设置图标 3.当菜单项(MenuItem)被选择时,

create Context Menu in Windows Forms application using C# z

In this article let us see how to create Context Menu in Windows Forms application using C# Introduction In this article we will see how to create Context Menu or Popup Menu or Shortcut menu in Windows Forms application with ContextMenuStrip control

Show Notepad++ in Windows Explorer context menu

Keywords: Register, Explorer context menu, Edit with Notepad++ Need to show "Edit with Notepad++" in Windows Explorer? If you have a copy (not installed) of Notepad++ and want this command in Explorer, register the following dll. regsvr32  D:\No

读论文 《TransForm Mapping Using Shared Decision Tree Context Clustering for HMM-based Cross-Lingual Speech Synthesis》(3)

3.1. Shareddecisiontreecontextclustering(STC) STC [11] was originally proposed to avoid generating speaker-biased leaf nodes in the tree construction of an average voice model. 果然,这里作者说了一下STC技术的出处在什么地方 然后简单的介绍了STC技术是用来解决什么问题的 在average voice model的树的构

Android 上下文菜单(Context Menu)

一.概述 Android中,上下文菜单是通过onLongClick(...)事件访问的.在事件触发后显示菜单项. 在使用上下文菜单时,通常在onCreate(...)方法中,先行注册上下文菜单.在实现onCreateContextMenu(...)方法和onContextItemSelected(...)方法. 注册菜单方法:registerForContextMenu(...) 注销注册菜单方法:unregisterForContextMenu(...) 二.使用XML文件添加上下文菜单 te