komarovalexander / ka-table

Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more
http://ka-table.com
MIT License
769 stars 56 forks source link

Sorting based on grouping of more than just one columnKey #353

Closed fshahmt closed 10 months ago

fshahmt commented 10 months ago

Hello team,

I have been spending a few hours a day for the past couple weeks trying everything I can think of to get my use case working and now finally decided to open an issue in hopes that one of the contributors either points me in the right direction or helps me out (we can talk it out if needed and possible at all).

Here is a fork of the demo that you guys have provided which I've been trying to tweak to my use case -

So my case is that I want the grouping to work on multiple levels. Level 1 and level 2 is the default ka-table sorting which works like a charm. Level 3 is where things get tricky.

I am trying to sort my data in the below format (hope it isn't too stupid or confusing)

-level1 --level2 ---level2items ---level3 ----level3items ---level2items (continued)

The way it works right now is

-level1 --level2 ---level2items ---level2items (this is supposed to be after the level 3) ---level3 ----level3items

I know this is kind of confusing and now believe that it might be out of scope for ka-table but who would be able to answer it better than the contributors.

PLEASE DON'T CLOSE THIS OFF BECAUSE I HAVE ALREADY SPENT 30+ HOURS OVER THE PAST COUPLE WEEKS TRYING TO FIGURE THIS OUT. ONLY CAME HERE AS A LAST RESORT.

komarovalexander commented 10 months ago

Hi @fshahmt I see you need tree mode, yes we have it check the demo: https://komarovalexander.github.io/ka-table/#/tree-mode

and check stackblitz example which is doing what you ask: https://stackblitz.com/edit/table-tree-mode-ts-qafm17?file=Demo.tsx