RowGroup callback

RowGroup callback

AndiWafflesAndiWaffles Posts: 4Questions: 2Answers: 0

Hey guys,
I am actual facing a tough issue concerning the RowGroup feature, following this thread https://datatables.net/forums/discussion/72368/rowgroup-collapse
So far grouping works fine, since it comes to searching the Table...

What I want to achieve is to collapse the first group in which the search term is in.
The easiest way for this is check the count of collapsed 'dtrg-group' (group headers) and if it is 0 trigger('click') the first one to expand it.

Unfortunately the drawCallback option is not suitable since this called before grouping the data...

Do you have any idea which option/callback I could use or is there an event fired when the grouping is finished?

Many thanks in advance for you help.

Regards, Andreas

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    There aren't any events for when rowGroup is complete. All the rowGroup events are listed here.

    With the collapsed RowGroup solution, you linked to, it uses the variable collapsedGroups to keep track of the collapsed groups. I think all you would need to do is manipulate the collapsedGroups object to reflect how you want the groups to be displayed when the search takes place. I would look at the search event. Wnen the rowGroup.startRender function runs it will have the updated collapsedGroups object to appropriately expand/collapse the groups. I think this would work better than trying to determine which groups to programmatically click.

    I'm not sure I understand how you want the search to affect the collapsed groups. If you want help with this please build a test case showing what you would like to do.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.