Grid page change event

7 posts, 0 answers
  1. Danish
    Danish avatar
    8 posts
    Member since:
    Dec 2011

    Posted 10 Feb 2012 Link to this post

    Hi,

    There doest not seem to be an event associated with page change. Is there any way I can figure out if a page change has occurred with information such as current page etc ?

    Regards,
    Danish
  2. Danish
    Danish avatar
    8 posts
    Member since:
    Dec 2011

    Posted 13 Feb 2012 Link to this post

    Any suggestions?
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 13 Feb 2012 Link to this post

    Hi Danish,

     dataBound event is fired when page changes. You can get current page index with page() method of the grid's dataSource.

    $("#grid").data("kendoGrid").dataSource.page();

    Greetings,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Lindon
    Lindon avatar
    2 posts
    Member since:
    Nov 2014

    Posted 27 Nov 2014 Link to this post

    try this!

    http://docs.telerik.com/kendo-ui/api/javascript/ui/pager#events-change

    var grid = $('#test_grid').data('kendoGrid');
    var pager = grid.pager;
    pager.bind('change', test_pagechange);
     
    function test_pagechange(e){
        console.log(e);
    }
  6. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 20 Feb 2015 in reply to Alexander Valchev Link to this post

    dataBound is fired after the page changes right? I know there is a new dataBinding, I assume the first too. With remote/ajax datasource, does dataBinding fire before the ajax query, or after but before the result is applied to the datasource object?

    Bottom line, I want to know when the user said to change the page, but before any of the existing data is destroyed. Basically, I wan't to autoSave and dirty rows in an editable grid when the user pages.

    thanks.
  7. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 25 Feb 2015 Link to this post

    Hello Bob,

    There are two different events - DataBound and DataBinding. The first one fires after the Ajax data is received and after the Grid rows are rendered in the DOM. The second one fires after the Ajax data is received but before Grid rows are rendered.

    DataBound will fire after the page changes. DataBinding will fire before the page changes.

    Bottom line, I want to know when the user said to change the page, but before any of the existing data is destroyed.

    You need the dataBinding event.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  8. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 27 Nov 2015 Link to this post

    There's a secret "undocumented" feature of the kendo grid, that is:

    $('#grid').kendoGrid({
    pageable: {
      pageSize: 2,
      change: function(e){alert('pager change event');}
    }
    The "change" event of the pageable property is not in the grid documentation, but it works!  

Back to Top
Kendo UI is VS 2017 Ready