Hi everybody!
Our customers asked us to make First and Last buttons to navigate through the grid pages. So I made this plugin.
I don't know if there is any other way to share kendo plugins, so I'll just place it here.
Our customers asked us to make First and Last buttons to navigate through the grid pages. So I made this plugin.
I don't know if there is any other way to share kendo plugins, so I'll just place it here.
/*
* Ivelum 2012
* Alexander Skogorev
* Adds 'First' and 'Last' buttons to the pager
*/
(
function
(a,b){
function
f(a,b,d,e){
return
a({idx:b,text:d,ns:c.ns,numeric:e})}
var
c=window.kendo,d=c.ui,e=d.Pager;
var
g=e.extend({refresh:
function
(){
var
a=
this
,b,c=1,d,g=a.page(),h=a.totalPages(),i=a.linkTemplate,j=a.options.buttonCount;e.fn.refresh.call(a);
if
(g>j){d=g%j;c=d===0?g-j+1:g-d+1}b=Math.min(c+j-1,h);
if
(c>1){a.list.prepend(f(i,1,
"First"
,
false
))}
if
(b<h){a.list.append(f(i,h,
"Last"
,
false
))}}});d.plugin(g)})(jQuery)