javascriptdatatablegridrowswebix

Displaying the number of rows in footer of webix grid


Is there an easy way to display the number of DataTable rows in its footer? I've found the demo with the counter in the footer with a summColumn function, but I can't find the function for counting rows.


Solution

  • You must defined a new dataFilter by extending summColumn like this:

    webix.ui.datafilter.countColumn = webix.extend({
        refresh: function (master, node, value) {
            var result = 0;
            master.mapCells(null, value.columnId, null, 1, function (value) {
                result++;
                return value;
            });
    
            node.firstChild.innerHTML = result;
        }
    }, webix.ui.datafilter.summColumn);