What's the best way of keeping the selected row in the tree view when the timeview is changed.
i.e. keep the row highlighted when the user clicks on the day/week/month/year tab
1 Answer, 1 is accepted
0
Peter Milchev
Telerik team
answered on 29 Mar 2021, 08:52 AM
Hello David,
This functionality can be achieved by "persisting" the selected task's data-uid attribute and subscribe once to the dataBound event of the underlying Kendo Gantt widget.
To achieve that, you can use the OnClientNavigationCommand client-side event with the following event handler declaration:
<script>functionOnClientNavigationCommand(sender, args) {
var kendoGantt = sender._widget;
var selected = kendoGantt.select();
if (selected[0]) {
var uid = selected[0].getAttribute("data-uid");
kendoGantt.one("dataBound", function () {
kendoGantt.select("[data-uid=" + uid + "]")
})
}
}
</script>
Regards,
Peter Milchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.