RedHeadphone / react-json-grid

🔄 Effortlessly transform complex nested JSON into grid tables
https://npmjs.com/package/@redheadphone/react-json-grid
MIT License
18 stars 4 forks source link

Add Expand All Feature #3

Closed RedHeadphone closed 1 year ago

RedHeadphone commented 1 year ago

The current version of react-json-grid doesn't provide an expand-all feature, which can be very useful when dealing with nested grids. Users have to manually expand each nested grid, which can become time-consuming and tedious. This issue proposes adding an expand-all prop to the JSONGrid Component that allows users to expand all nested grids with ease, enhancing the user experience and improving usability.

RedHeadphone commented 1 year ago

Better approach I think is a props defaultExpandDepth which takes integer value (default value: 0 and min value: 0), which makes all nested grid with depth <= defaultExpandDepth expanded by default

RedHeadphone commented 1 year ago

Possible new feature: A prop that accepts key-tree (tree like structure object with all keys that needs to be expanded) and expands all grid according to the key-tree. This can be useful if someone wants to keep selective nested grid open by default.