nestedRows and columnSorting and filtering

Tags: #<Tag:0x00007f8b1d735ff0>

I enabled nestedRows: true and noticed that columnSorting: true and filters: true kind of goes crazy. For sorting, I found this issue describes my problem:

I notice there’s a feature request in the wiki but it’s way far down the list. Is there any hope to get nestedRows and columnSorting to work together? Is there any workaround? What would be involved to rework the sorting plugin to support nestedRows?

I also noticed that refactoring sorting plugin is on the roadmap, by any chance is it a good time to make it work with nestedRows?

Hi @abeall

the easiest way to solve it would be to create a custom context menu and use the alter method to add or delete rows. With deleting it is easy. A bit more difficult is adding parent row.

ps. the refactoring is already done. We have made it in v 6.0.0 where we also added multiColumn sorting

@aleksandra_budnik I guess I should upgrade to 6.0.0 and see if nestedRows and columnSorting work better together there?

It sounds like you’re describing a custom nested row like behavior. The nestedRows actually works great, the problem is the columnSorting plugin will sort all rows individually, including nested ones, rather than keeping the nested rows nested under their parents… the [+] and [-] icons also get out of place with the sorted rows.

I’m looking into using a custom sort functions. Basically I just need to trick the sort order to keep nested rows below parent rows at all times.

Oh yes, sorry. I misunderstand the case.
You are right, currently we do not differ between parent or child while sorting or filtering. That is why the nestedRows feature is still in the experimental features zone in our docs.

@aleksandra_budnik Any timeline when nestedRows will no longer be “experimental”? We really need this feature. :slight_smile:

1 Like

Sorry, I do not know anything about the plans for 2019. Here’s what is planned for December https://github.com/handsontable/handsontable/milestones/December%202018 (nothing related to nestedRows).