General Failure
General Failure

Reputation: 2597

May i expand or collapse kendo gantt tasks programmatically?

I have a kendo gantt chart http://docs.telerik.com/kendo-ui/api/javascript/ui/gantt

Can i expand and collapse its items programmatically?

Kendo gantt documentation hasn't such methods, but may be is possible to expand tasks via jQuery?

Also i tried expand tasks by changing expanded property for selected task:

var selection = gantt.select();
if (selection) {
    var task = gantt.dataItem(selection);
    console.log('task.expanded = ' + task.expanded); // shows true or false depending on visual state
    task.expanded = true;
    console.log('task.expanded = ' + task.expanded); // always shows true
}

Property expanded sets, but visually nothing has changes

Upvotes: 1

Views: 1799

Answers (1)

Joe
Joe

Reputation: 5487

You can set this via the datasource and the chart will update without having to manually call refresh. $("#gantt").data("kendoGantt").dataSource.view()[0].set("expanded", false)

docs

Upvotes: 3

Related Questions