SMART datagrid v.1 > Classes > GridView

Back  Forward

DataLudi.GridView.setPageAndOffset  method

Set the page location and location distance of first row of page at the same time when the grid is in Paging state. 

If the value of offset is less than 0, it will display from the former row as much as the specified number than the rows which will have been displayed originally, and if greater than 0, it will display from the latter. For example, if it is -10, when pageIndex is 1 and pageSize is 10, it will display from the first row rather than the 11th row. 

You can separately set offset by pageOffset. Please refer to Paging Offset example. 

function setPageAndOffset (page: Integer, offset: Integer);
Returns
Void
Parameters
page - Integer. required.
offset - Integer. required.
Code -1
    $('#incpage').click(function (ev) {
        // Always display from the first row.
        var newPage = grid.pageIndex() + 1;
        grid.setPageOffset(newPage, -newPage * grid.pageSize());
    });
See Also
paged
pageIndex
pageOffset
setPaging
pageCount
setPageAndRows
Examples
Paging
Paging Data
Paging Offset
Paging Rows