Gantt open performance issue

Hi everyone.

I have trouble with perfomance.

My task tree has 4 level with 800 tasks. Initially tree is collapsed.
I need custom button to able expand all level. I tried to use method but it works very slow.

Is there another way to do this?

Best regards.

you can set the property “$open” of each task to true of false and redraw the whole gantt
Check the snippet

Thank you!!