Pager issue when at going over boundry.

4 posts, 0 answers
  1. Benjamin
    Benjamin avatar
    2 posts
    Member since:
    Dec 2012

    Posted 14 Dec 2012 Link to this post

    I've got an application that uses custom onclick events in the pager controls to redraw html elements in the grid upon paging. This works great for everything except going past the boundries. I haven't been able to figure out a way to prevent the First and Previous buttons from firing the onclick event when the currently selected page is in the first page and preventing the Next and Last buttons from firing onclick events when the currently selected page is the last page.

    I've also noticed that once a paging event occurs the numerical links 1, 2, 3.... are rewritten and any custom events assigned to them get removed. How can I tell that a paging event is has just occured and re-bind the onclick events to the paging numerical links?

    Thanks!
  2. Marcin Butlak
    Marcin Butlak avatar
    26 posts
    Member since:
    Dec 2012

    Posted 14 Dec 2012 Link to this post

    Rather then binding manually to html links of pager controls use the change event of the pager object instance in the Grid:
    var grid = $("#grid_id").data("kendoGrid");
     
    grid.pager.bind('change', function() {
       var currentPage = this.page();
    });
  3. Kendo UI is VS 2017 Ready
  4. Benjamin
    Benjamin avatar
    2 posts
    Member since:
    Dec 2012

    Posted 14 Dec 2012 Link to this post

    Hi Marcin,

    Thank you for your prompt reply. Does change fire with the Pager? I wasn't aware of that. I'll have to do some experminentation. How would this allow me to check for out of bounds conditions as explained above?
  5. Marcin Butlak
    Marcin Butlak avatar
    26 posts
    Member since:
    Dec 2012

    Posted 15 Dec 2012 Link to this post

    You don't have to check out of bounds conditions because the event is only fired on valid page changes.
Back to Top
Kendo UI is VS 2017 Ready