This is a migrated thread and some comments may be shown as answers.

Pager issue when at going over boundry.

3 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 14 Dec 2012, 06:56 PM
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!

3 Answers, 1 is accepted

Sort by
0
Marcin Butlak
Top achievements
Rank 2
answered on 14 Dec 2012, 07:53 PM
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();
});
0
Benjamin
Top achievements
Rank 1
answered on 14 Dec 2012, 08:51 PM
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?
0
Marcin Butlak
Top achievements
Rank 2
answered on 15 Dec 2012, 02:26 PM
You don't have to check out of bounds conditions because the event is only fired on valid page changes.
Tags
Grid
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Marcin Butlak
Top achievements
Rank 2
Benjamin
Top achievements
Rank 1
Share this question
or