RowGroup with Pagination

RowGroup with Pagination

kripton76kripton76 Posts: 5Questions: 3Answers: 0

Hi, I have a table with row grouping and maximum pageLength of 10. however if I have a group of more than one item in the last row the table splits the group across two pages.
Is there a way to force the the groups into one page?

    var collapsedGroups = {};
    var table = $('#Datatable').DataTable({
        //--remove sorting form the last column
        //last column do not sort
        columnDefs: [{ orderable: false, targets: [0,9] },
        { "searchable": false, "targets": [0, 9] }
        ],
        order: [[1, 'asc']],
        rowGroup: {
            dataSrc: [1],
            startRender: function (rows, group) {
                var collapsed = !!collapsedGroups[group];
                rows.nodes().each(function (r) {
                    r.style.display = collapsed ? '' : 'none';

                });
                return $('<tr class="thinBorder" style="">')
                    .append("<td class=' details-control'></td>")
                    .append("<td class='' colspan='2'>" + group +"</td>")
                    .append('<td colspan="7"> Number of players (' + rows.count() + ')</td></tr>')
                    .attr('data-name', group)
                    .toggleClass('collapsed', !collapsed);

            },

        },
        "pageLength": 10,
        stateSave: true,
        language: { search: "Filter by", emptyTable: "No registrants found." },
        dom: 'Btip'

    });

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @kripton76 ,

    That's not possible, I'm afraid - as you say, the group will be split across the page.

    Cheers,

    Colin

This discussion has been closed.