Santhosh Ramini
Santhosh Ramini

Reputation: 394

Kendo UI Diagram ShapeDefaults Content Template

Can we use a kendo Template in the shapeDefaults Content template part in below code?

$("#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
    }
});

Upvotes: 1

Views: 1272

Answers (1)

Francois Vanderseypen
Francois Vanderseypen

Reputation: 1521

Your code is correct but there is a bug in the Kendo code; the content visual is not added on redraw when using templates. You can wait for next release or simply add it in the redrawVisual method, it should be;

redrawVisual: function() {
            this.visual.clear();
            this.shapeVisual = Shape.createShapeVisual(this.options);
            this.visual.append(this.shapeVisual);
            this.visual.append(this._contentVisual);
            this.updateBounds();
        }

Upvotes: 1

Related Questions