Expand/collapse all gantt elements on certain level

1 Answer 67 Views
Gantt
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
Vedad asked on 08 Jul 2021, 02:30 PM | edited on 13 Jul 2021, 10:57 AM

Hi,

I recently upgraded our apps to latest kendo UI version and one of things we had implemented is broken: 

Collapse/expand gantt list to a certain level (for example I want only first or first two levels to be expanded).

Before we used data-level property that was part of gantt list, but it seems that with R3 2020 since gantt custom list was replaced with a treelist this is gone.

Was this property removed by accident or it is intentional? If it was intentional, could you advice on new approach.

I would like avoid iterating through all elements and finding structure, since we have cases where projects have a lot of elements and also some other conditions included.

Thanks

Ianko
Telerik team
commented on 13 Jul 2021, 09:43 AM

Typically, with the update, everything should work the same. 

Can you show what is the code and approach that you are using to expand to a certain level? If you are using public and documented methods for that it should be working as expected. If, however, you are using some custom logic for that it might need to be adjusted according to the TreeList update.

Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 13 Jul 2021, 10:57 AM | edited

Hi Ianko,

Currently I am using approach that is suggested by Kendo on https://docs.telerik.com/kendo-ui/knowledge-base/gantt-expand-collapse-alltasks

However it iterates through all elements and expands collapses everything.

As I wrote in original question, there was a property in each tr named data-level - which basically told us on which level is element in hierarchy.
I used this property to determine whether element should be collapsed or not. Since element is gone, there is no (obvious) way to know where in hierarchy element sits.

I uploadad two screenshots to my original question, as I don't see upload option in comment section.

THanks

1 Answer, 1 is accepted

Sort by
1
Accepted
Ianko
Telerik team
answered on 14 Jul 2021, 07:37 AM

Hello Vedad,

Thank you for the additional information about the data-level attribute. It is removed because with the TreeList addition the GanttDataSource inherits a level method that easily enables you to get the level from the data item: https://docs.telerik.com/kendo-ui/api/javascript/data/treelistdatasource/methods/level

Here you are a dojo example: https://dojo.telerik.com/@iankodj/edUHiCac 

Regards,
Ianko
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/.

Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 23 Jul 2021, 11:34 AM

Hi Ianko, this makes sense and it seems to work. Thanks a lot!
Cheers,
Vedad
Tags
Gantt
Asked by
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
Answers by
Ianko
Telerik team
Share this question
or