【问题标题】:getOrgChart 2.0.6 compatibility with jQuerygetOrgChart 2.0.6 与 jQuery 的兼容性
【发布时间】:2016-10-28 08:17:33
【问题描述】:

我使用的是 getOrgChart 2.0.6,但对 jquery 的依赖似乎已被删除。

现在,我想修改“clickevent”,但我在 www.getorgchart.com 的文档区域中找到的所有示例都需要 jQuery。

(例如:http://www.getorgchart.com/Documentation#clickEvent

正确的语法是什么?如果不使用 jQuery,则不会触发事件。

【问题讨论】:

    标签: jquery getorgchart


    【解决方案1】:

    这是 2.0.7 版中的正确语法:

    var orgchart = new getOrgChart(document.getElementById("people"), {
        clickNodeEvent: clickHandler,   
        dataSource: [{id: 1,parentId: null,Name: "Amber McKenzie"}, {id: 2,parentId: 1,Name: "Ava Field"}, {id: 3,parentId: 1,Name: "Evie Johnson"}]
    });
    
    function clickHandler(sender, args) {
      alert("clecked node.id " + args.node.id);
    }
    

    有关更多信息,请参阅文档:http://www.getorgchart.com/Documentation#clickNodeEvent

    【讨论】:

      猜你喜欢
      • 2020-11-10
      • 1970-01-01
      • 2016-08-15
      • 1970-01-01
      • 1970-01-01
      • 2014-07-21
      • 1970-01-01
      • 1970-01-01
      • 2011-09-13
      相关资源
      最近更新 更多