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>

转载于:https://www.cnblogs.com/telwanggs/p/4533272.html

Tree Context Menu相关推荐

  1. ABAP:为Table Control创建Context Menu

    1,创建一个GUI Status 在SE80中点击程序名,并点击右键的创建,找到GUI Status. 它与普通菜单栏的定义没什么不同,但是Status Type必须选择Context Menu,假设 ...

  2. 手机浏览器中屏蔽img的系统右键菜单context menu

    我们知道通过oncontextmenu事件可以屏蔽浏览器右键菜单 $('img').on("contextmenu",function(E){E.preventDefault(); ...

  3. context menu

    android的菜单有三种: Options Menu 当用户按下menu button按钮时显示的菜单 Context Menu 当用户长久按住屏幕,即被注册显示上下文菜单的视图时显示的菜单 Sub ...

  4. Sublime text 3安装时,add to explorer context menu是什么意思?

    上下文菜单(context menu),Windows操作系统中任何地方右击鼠标会出现俗称的"右键菜单",其实就是指上下文菜单.因为上下文菜单根据鼠标位置来判断弹出什么的菜单(如桌 ...

  5. sublime text 3安装-add to explorer context menu意思

    sublime text 3安装-add to explorer context menu意思 正文 在sublime text 3安装完成之后,会出现 "add to explorer c ...

  6. Select: Maven-Update Project... from the project context menu or use Quick Fix. spark-MT line 1

    Description Resource Path Location Type Project configuration is not up-to-date with pom.xml. Select ...

  7. 5.4 Android 的上下文菜单: Context Menu,registerForContextMenu(getListView())

    Android 的上下文菜单: Context Menu,registerForContextMenu(getListView()) Android 的上下文菜单类似于 PC 上的右键菜单.当为一个视 ...

  8. Android 上下文菜单(Context Menu)

    一.概述 Android中,上下文菜单是通过onLongClick(...)事件访问的.在事件触发后显示菜单项. 在使用上下文菜单时,通常在onCreate(...)方法中,先行注册上下文菜单.在实现 ...

  9. EasyUI(1) 使用方法、引入、创建组件、LinkButton、panel、tree、Menu

    第一步:点击去官网下载EasyUI 第二步:项目中导入easyui所需东西 第三步:引入EasyUI <!-- easyui样式支持 --><link rel="style ...

最新文章

  1. 成为优秀UI设计师需要具备哪些条件?
  2. 全球与中国激光投影设备市场前景规划与发展战略建议报告2022-2028年版
  3. [原创] JS 继承详解。欢迎拍砖
  4. python编程(最简单的rpc代码)
  5. 概率论中的一些常见的分布与公式
  6. c语言编程的现状,C语言编程开发发展现状分析
  7. android 65536
  8. signature=e7b038f264f5a1cf5b8e81732b377b41,不同养生功法对2型糖尿病伴失眠患者抑郁,焦虑和睡眠质量的影响...
  9. 解读 Apache 多个顶级数据库项目的成长经历与开源文化理念
  10. 怎样用python中matplotlib模块直观的将股票数据展现出来
  11. Vue响应式原理(看这一篇就够了)
  12. 指纹识别实战——基于TensorFlow实现(文末送书)
  13. 金融风控训练营Task1学习笔记
  14. 【iOS】—— KVC的简单介绍
  15. 国外卫星地图 Sentinel Hub EO Browser的使用
  16. Windows系统下自带压缩文件工具之makecab
  17. signature=9ec7312ca38211888b9ef1a6aa3edb68,(În C)erneală uscată. Dezbătând (până la) limite
  18. 学完数据分析怎样就业,数据分析发展前景怎么样
  19. BOM、body的位置属性
  20. 深入华为研发最核心地带:产品规划,聆听华为最大产品经理:任总,对产品规划理解:产品规划如何客户需求导向?如何对待变态需求?如何把握市场节凑?

热门文章

  1. (20)Xilinx PCIE中断调试成功(学无止境)
  2. (125)FPGA面试题-熟悉AXI总线吗,介绍AXI
  3. (63)FPGA面试题-用verilog写一段代码,实现消除一个glitch(毛刺)(二)
  4. jpa使用注解传递对象_注解(下)
  5. LWIP源代码文件目录解析
  6. linux紧急救援模式,如何在 Ubuntu 18.04 中启动到救援模式或紧急模式
  7. Linux线程属性及优先级设置
  8. SVD 与 PCA 的直观解释(3): SVD的直观解释及推导
  9. 结构体:struct关键字
  10. electron 打印需要联网的吗?_英语四六级考试准考证怎么打印,需要彩打吗