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

Customize Pageable Label Options

3 Answers 397 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jeff
Top achievements
Rank 1
jeff asked on 04 Feb 2015, 08:39 PM
Hi folks!
For 'continuities sake', I need to customize the Grid pageable: options - do I need to edit the js library itself to modify the layout (I REALLY don't want to have to do that..), or is there a method to modifying the pageable template?

Currently, the kendo ui pagination is:

go to first page / go to the previous page / page numbers / go to next page / go to last page

we just want a single 'previous' button and a single 'next' button, with text labels instead of glyphs.. 

previous / page numbers / next

Thank you!

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 06 Feb 2015, 10:50 AM

Hello Jeff,


The scenario is not supported out of the box. It could be achieved by applying custom CSS styles and modifying the existing ones via jQuery. Here is a sample approach that you could use as a base and modify manually if needed. In the example I am hiding the first/last buttons

.k-pager-first, .k-pager-last {
    display:none;
}
and modifying the prev/next buttons via jQuery.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jeff
Top achievements
Rank 1
answered on 06 Feb 2015, 06:41 PM
That definitely got me in the ballpark, thank you very much. If one ever finds themselves in this situation, here's what I ended up doing to get it a little closer:

01.var pager = $("#grid .k-grid-pager");
02. 
03.pager.find(".k-pager-nav").eq(1)
04..find("span").text("Previous")
05..removeClass("k-icon")
06..parent().css({
07.    'padding' : '0 6px',
08.    'border-radius' : '4px 0 0 4px',
09.    'text-decoration' : 'none'
10.});
11.      
12.pager.find(".k-pager-nav").eq(2)
13..find("span").text("Next")
14..removeClass("k-icon")
15..parent().css({
16.    'padding' : '0 6px',
17.    'border-radius' : '0 4px 4px 0',
18.    'border-right-color' : '#cccccc',
19.    'border-right-style' : 'solid',
20.    'border-right-width' : '1px',
21.    'text-decoration' : 'none'
22.});
0
Dimiter Madjarov
Telerik team
answered on 10 Feb 2015, 08:49 AM

Hello Jeff,

Thanks for the update. I am glad the issue is resolved.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
jeff
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
jeff
Top achievements
Rank 1
Share this question
or