Open srhong007 opened 2 months ago
It is very neat solution!
Is it possible to implement the same functionality here and to share the link
You can include it in the existing source, but I tried it in an additional way. This is a function that uses a simple recursive call. share link https://code.balkan.app/create-collaps-all-button-in-orgchartjs-ui#JS
Thank you for the code example. You can see here our collapse all example: https://code.balkan.app/org-chart-js/collapse-children-on-expand-and-collapse-all-button#JS
Thank you. I already saw it too.
Hello.
Because it is implemented as an organization chart provided by OrgChart JS, an expand all button is provided, but a collapse all button is not provided.
Instead of creating a separate Collapse All button, we placed it directly in the OrgChart UI and implemented the source code so that it can only be closed up to the expansion level (-) set in the options.
https://cafe.naver.com/gisapplication/1227
Click the Expand All button to open all images. Create a button image.
o && o.addEventListener("click", function() { l.obj.expand(null, "all"); l.obj.fit(); }), oo && oo.addEventListener("click", function() { //l.obj.collapse(null, "all"); //srhong007 var collapse_level = l.obj.config.collapse.level || 0; collapse_level-=2; Node_collapse(l.obj.roots); l.obj.fit();