constantin-p / cp-react-tree-table

A fast, efficient tree table component for ReactJS.
https://constantin.software/cp-react-tree-table
MIT License
95 stars 27 forks source link

'Expand All' and 'Collapse All' buttons. #8

Closed dexter-skr closed 6 years ago

dexter-skr commented 6 years ago

Hi, Am trying to create 'Expand All' and 'Collapse All' buttons for the tree

Here is a fiddle, where I tried to achieve 'Expand All' utilizing 'scrollIntoView' https://jsfiddle.net/sujaikarthik/Lystd2j9/47/

Above method did not work when there was lot of data. Also, I wasn't able to utilize any other methods to achieve 'Collapse All'

Can you please help by providing any methods , I could use to achieve both 'Expand All' and 'Collapse All'

Thanks

constantin-p commented 6 years ago

Hi @SujaiRaj,

I'm gonna take a look at implementing this functionality by the end of this week.

constantin-p commented 6 years ago

Hi @SujaiRaj ,

You can now achieve the functionality you're looking for by using the 2 new public methods expandAll() and collapseAll(), introduced by commit 2b6fca698b4ea1e19e4866f2608c21655c8a97b4 and available to use in v0.7.0.

Demo

dexter-skr commented 6 years ago

Hi @constantin-p ,
Got this error, after I updated the version to 0.7. ( no changes in my local code )

screen shot 2018-10-08 at 11 07 14

constantin-p commented 6 years ago

Can you test with v0.7.1. If the bug persists can you post a JSFiddle in which I can reproduce the error?

dexter-skr commented 6 years ago

Hi @constantin-p , No errors in V0.7.1. Working perfectly now. Thanks a lot