SMART datagrid v.1 > Examples

[ grids ver.1.3.8]   Back  Forward

Paging - Page Rows  Example

First, we will check Paging Overview and Basic Examples about the paging in SMART datagrid. 

You can also randomly specify the data set which will be displayed in each page apart from the data row group which is currently created in the grid. You can call setPageAndRows and specify when the page is changed, or call GridView.pageRows within the page change event handler and specify it. 

Code -1
    grid.onPageIndexChanged = function (grid, oldPage, newPage) {
        var rows = [];
        if (ds.rowCount() > 0) {
            while (rows.length < 5) {
                var r = parseInt(Math.random() * ds.rowCount());
                if (rows.indexOf(r) < 0) {
                    rows.push(r);
                }
            }
        }
        grid.setPageRows(rows);    
    };
Grid - 1
Code -2
    btnFirst2_click: function (ev) {
        var p = grdMain2.pageIndex() * 10;
        grdMain2.setPageAndRows(0, [p + 2, p + 4, p + 3, p + 5, p + 7]);
    },
Grid - 2

View Source JSP 

See Also
Paging Overview
GridView.pageRows
GridView.setPageAndRows
GridView.setPaging
GridView.pageIndex
GridView.pageCount
GridView.onPaged
GridView.onPageCountChanged
GridView.onPageIndexChanging
GridView.onPageIndexChanged
Examples
Paging
Paging Data
Paging Offset