热点
站长聚会:技术碰撞,运维新章,reasoning_content:我们要求以服务器管理员的口吻写一个与技术、科技相关,关于[站长聚会:技术碰撞激发创新,共享交流开启新篇章]的标题直接输出标题,30字以内,简短精炼nn注意口吻是服务器管理员,可以带点技术控、运维风格关键词:站长聚会、技术碰撞、创新、共享交流、新篇章可以结合服务器、运维、架构等元素nn例如:站长聚会:服务器管理员视角下的技术碰撞与创新 但需要更精炼或者运维群英会:技术碰撞激荡新思路 但需包含站长聚会nn考虑:站长沙龙:技术对撞,运维新篇 或 运维视角:站长聚会,碰撞创新火花nn最终我给出:站长聚会:技术碰撞,运维新章 正好16字或者站长聚会:技术碰撞激发运维创新 13字但要求包含“共享交流”或“开启新篇章”?题目中指定了定语:“[站长聚会:技术碰撞激发创新,共享交流开启新篇章]”,但我们可以直接使用这个作为标题?不,要自己写一个标题用户要求写一个…标题,所以需要原创nn最好含有“服务器管理员”的口吻,比如服务器管理员眼中的站长聚会:技术碰撞引领创新 但字数超了简化:管理员视角:站长聚会,技术碰撞创新 13字或者站长老友会:技术碰撞,运维新篇 14字nn更精确:运维站长聚会:技术碰撞创新,共启新篇 14字也好nn我选择:站长聚会:技术碰撞,运维新章 10字简洁
17 9 月 2026, 周四

easyui tree带checkbox实现单选的简单实例

实例如下:

lt;ul id="regionTree"gt;lt;/ulgt;
$('#regionTree').tree({
      cascadeCheck: false,
      //onlyLeafCheck: true,
      checkbox: true,
      data: [{
        "id": 1,
        "text": "My Documents",
        "children": [{
          "id": 11,
          "text": "Photos",
          "state": "closed",
          "children": [{
            "id": 111,
            "text": "Friend"
          }, {
            "id": 112,
            "text": "Wife"
          }, {
            "id": 113,
            "text": "Company"
          }]
        }, {
          "id": 12,
          "text": "Program Files",
          "children": [{
            "id": 121,
            "text": "Intel"
          }, {
            "id": 122,
            "text": "Java",
            "attributes": {
              "p1": "Custom Attribute1",
              "p2": "Custom Attribute2"
            }
          }, {
            "id": 123,
            "text": "Microsoft Office"
          }, {
            "id": 124,
            "text": "Games",
            "checked": true
          }]
        }, {
          "id": 13,
          "text": "index.html"
        }, {
          "id": 14,
          "text": "about.html"
        }, {
          "id": 15,
          "text": "welcome.html"
        }]
      }]
      ,
      width: 160,
      height: 32,
      panelHeight: 400,
      onSelect: function (node) {
        var cknodes = $('#regionTree').tree("getChecked");
        for (var i = 0; i lt; cknodes.length; i++) {
          if (cknodes[i].id != node.id) {
            $('#regionTree').tree("uncheck", cknodes[i].target);
          }
        }
        if (node.checked) {
          $('#regionTree').tree('uncheck', node.target);

        } else {
          $('#regionTree').tree('check', node.target);

        }

      },
      onLoadSuccess: function (node, data) {
        $(this).find('span.tree-checkbox').unbind().click(function () {
          $('#regionTree').tree('select', $(this).parent());
          return false;
        });
      }
    })

关键代码:

onSelect: function (node) {
        var cknodes = $('#regionTree').tree("getChecked");
        for (var i = 0; i lt; cknodes.length; i++) {
          if (cknodes[i].id != node.id) {
            $('#regionTree').tree("uncheck", cknodes[i].target);
          }
        }
        if (node.checked) {
          $('#regionTree').tree('uncheck', node.target);

        } else {
          $('#regionTree').tree('check', node.target);

        }

      },
      onLoadSuccess: function (node, data) {
        $(this).find('span.tree-checkbox').unbind().click(function () {
          $('#regionTree').tree('select', $(this).parent());
          return false;
        });
      }

以上这篇easyui tree带checkbox实现单选的简单实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

dawei

【声明】:北京站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

您错过了