Webix Treetable with pagination and grouping

443 Views Asked by At

I'm using a webix treetable with data loading from a server url with pagination. Server url loads 100 records per page with total_count as say 1000.

It works fine so far.

But if I apply grouping on a column, it's throwing error. When I debug I understood that it's failing because it's trying to process 1000 records (based on the total_count) where as there are only 100 records loaded so far and throwing an error.

Is it possible to have grouping + remote pagination together on webix treetable.

Please check the sample code I'm using -

webix.ready(function () {
        var gridColumns = [{
            // ...
        }];

        var grid = webix.ui({
            container: "testA",
            view: "treetable",
            columns: gridColumns,
            url: "server-url.php"
            scheme: {
                $group: gridColumns[0].id
            },
            datafetch: 100,
            pager: {
                container: "paging_here",// the container where the pager controls will be placed into
                size: 100, // the number of records per a page
                group: 5   // the number of pages in the pager
            }
        });
    });

and the html is

<div id="testA" style='width:1200px; height:600px;'></div>
<div id="paging_here"></div>
1

There are 1 best solutions below

1
Aquatic On

It will not work, unfortunately. The grouping requires that all data is available on the client side, which means it doesn't compatible with dynamic loading.

If you have up to few thousands of records, you an try to load all data at once. Except the extra bandwidth, it will not have a negative impact on the performance.