ghiscoding / slickgrid-react

Slickgrid-React is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
https://ghiscoding.github.io/slickgrid-react/
MIT License
31 stars 9 forks source link

Tree Data and the "optional" initialSort property | expand / collapse icons to not render #394

Closed ghiscoding closed 1 month ago

ghiscoding commented 1 month ago

Discussed in https://github.com/ghiscoding/slickgrid-react/discussions/393

Originally posted by **tnaum-ms** August 16, 2024 I'm curious about your experience with Tree Data in SlickGrid. I'm fairly new to SlickGrid and started by following some of the examples provided, specifically [Example 27](https://github.com/ghiscoding/slickgrid-react/blob/master/src/examples/slickgrid/Example27.tsx). I also read the very helpful article on Tree Data [here](https://ghiscoding.gitbook.io/slickgrid-universal/grid-functionalities/tree-data-grid#parentchild-relation-dataset). While exploring the `initialSort` property, I encountered an issue. Although it seems optional and is marked as such in the comments, omitting it causes the expand/collapse chevrons to not render (the classes `expanded` / `collapsed` aren't set). I was able to reproduce this not only in my code but also in the Example 27 source code. For reference, the relevant lines are: ```typescript initialSort: { columnId: 'title', direction: 'ASC' }, ``` | **Original Example 27** | **Example 27 with Lines Commented Out** | |---------------------------------------------|--------------------------------------------| |![image](https://github.com/user-attachments/assets/8689b3e0-89b5-4e5a-82c9-ebd91f93925a) | ![image](https://github.com/user-attachments/assets/40fe087d-14da-40be-9de1-dfa0a3183808) |