我们可以在下面代码的 shapeDefaults内容模板部分中使用剑道模板吗?
$("#diagram").kendoDiagram({
dataSource: [{
"name" : "Telerik",
"items": [
{"name": "Kendo", "items": [{"name": "Kendo", "items":[{"name":"abc"}]}]}
],
}],
shapeDefaults: {
content:{template: "#=item.name#"}, //Need to use a kendo template here
editable: true
}
});
答案 0 :(得分:1)
您的代码是正确的但是Kendo代码中存在错误;使用模板时,不会在重绘时添加内容visual。 您可以等待下一个版本或只是将其添加到 redrawVisual 方法中,它应该是;
redrawVisual: function() {
this.visual.clear();
this.shapeVisual = Shape.createShapeVisual(this.options);
this.visual.append(this.shapeVisual);
this.visual.append(this._contentVisual);
this.updateBounds();
}