0

我使用 getOrgChart 已经有一段时间了。有了这个新的更新,我遇到了一些问题。我使用了事件“renderBoxContentEvent”(现在已重命名为“renderEvent”),但现在,这个新函数永远不会被调用。按照代码片段:

orgChart = new getOrgChart(peopleElement, {
        theme: "annabel",
        primaryFields: ["Area", "Nome"],
        photoFields: ["Imagem"],
        linkType: "M",
        enableEdit: true,
        enableDetailsView: false,        
        expandToLevel: 2,
        renderEvent: renderBox,
        renderBoxContentEvent:renderBox,
        updatedEvent: updatedEvent,
        dataSource: dsOriginalCopy,
    });
function renderBox(sender, args) {
    alert(1);
}

有任何想法吗?

4

1 回答 1

0

实际上它在 2.0.7 版本中被重命名为 renderNodeEvent。这是一个例子:

    var orgchart = new getOrgChart(document.getElementById("people"), {
    renderNodeEvent: renderNodeEvent,
    dataSource: [{id: 1,parentId: null,Name: "Amber McKenzie"}, {id: 2,parentId: 1,Name: "Ava Field"}, {id: 3,parentId: 1,Name: "Evie Johnson"}]
});
function renderNodeEvent(sender, args) {
    args.content[2] = args.content[2].replace("Amber McKenzie", "The name has been replaced");
}

请参阅文档:http ://www.getorgchart.com/Documentation#renderNodeEvent

并下载最新版本: http ://www.getorgchart.com/Download

于 2016-10-30T17:09:20.053 回答