Skip to content

New-HTMLTableRowGrouping for more then one field #251

Open

Description

@tomerikko

Hey Master PrzemyslawKlys,
I was to do subgrouping for a table, anyway this can be done with New-HTMLTableRowGrouping ? since it looks like it takes only one field.

for example, i have a global user list, i want to group them by geographic location, and then in that geo grouping, to group them again by manager.

Activity

  1. tomerikko commented on Aug 2, 2021

    @tomerikko
    Author

    @PrzemyslawKlys , any thoughts would be appreciated :)

  2. PrzemyslawKlys commented on Aug 2, 2021

    @PrzemyslawKlys
    Member

    I did quick implementation and I think I did it using a plugin

                                            rowGroup: {
                                                // Uses the 'row group' plugin
                                                dataSrc: 2,
                                                startRender: function (rows, group) {
                                                    var collapsed = !!collapsedGroups[group];
    
                                                    rows.nodes().each(function (r) {
                                                        r.style.display = collapsed ? 'none' : '';
                                                    });
    
                                                    var toggleClass = collapsed ? 'fa-plus-square' : 'fa-minus-square';
    
                                                    // Add group name to <tr>
                                                    return $('<tr/>')
                                                        .append('<td colspan="' + rows.columns()[0].length + '">' + '<span class="fa fa-fw ' + toggleClass + ' toggler"/> ' + group + ' (' + rows.count() + ')</td>')
                                                        .attr('data-name', group)
                                                        .toggleClass('collapsed', collapsed);
                                                },
                                            },

    While what I can see:

            rowGroup: {
                dataSrc: [ 5, 1 ]
            },
            columnDefs: [ {
                targets: [ 1, 2 ],
                visible: false
            } ],

    Is much easier but also with more options.

  3. PrzemyslawKlys commented on Oct 30, 2026

    @PrzemyslawKlys
    Member

    Multiple row-grouping levels are supported by the change merged in #533, with independent collapse state for each group path. This covers grouping by location and then by manager. The updated module has not been published yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfuturePossibly will show up in future

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions