我使用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);
}
有什么想法吗?
答案 0 :(得分: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