[SOLVED] Customizing pagination (using two_numbers as a base)
[SOLVED] Customizing pagination (using two_numbers as a base)
I'm trying to expand the two_numbers pagination to look roughly like:
[quote]
< Showing x-y of z >
[/quote]
But have run into some issues. Taking two_numbers from 1.9 as my base, I added the a span between the left and right arrows for the jQuery UI pagination controls in fnInit:
[code]
var sAppend = (!oSettings.bJUI) ?
''+oLang.sPrevious+''+
''+oLang.sNext+''
:
''+
''+
'';
$(nPaging).append( sAppend );
[/code]
I then made a few changes to fnUpdate, in particular adding a call that updates the span I added (see /* Info */) and changed the 'next' node call to nNode.nextSibling to nNode.nextSibling.nextSibling so it skips over my span (first line under /* Next page */):
[code]
/* Loop over each instance of the pager */
for ( var i=0, iLen=an.length ; i
[quote]
< Showing x-y of z >
[/quote]
But have run into some issues. Taking two_numbers from 1.9 as my base, I added the a span between the left and right arrows for the jQuery UI pagination controls in fnInit:
[code]
var sAppend = (!oSettings.bJUI) ?
''+oLang.sPrevious+''+
''+oLang.sNext+''
:
''+
''+
'';
$(nPaging).append( sAppend );
[/code]
I then made a few changes to fnUpdate, in particular adding a call that updates the span I added (see /* Info */) and changed the 'next' node call to nNode.nextSibling to nNode.nextSibling.nextSibling so it skips over my span (first line under /* Next page */):
[code]
/* Loop over each instance of the pager */
for ( var i=0, iLen=an.length ; i
This discussion has been closed.
Replies
[code]"sPaginationType": "full_numbers",[/code]
Do you just like the arrows better ?
The internal variables for paging are a bit messy I know :-(. They need to be cleaned up at some point, but doing so will breaking existing code - such as your own now!
Allan
@allan - Awesome, that worked perfectly. Thanks!
The updated jsfiddle: http://jsfiddle.net/UWWqD/2/
I also changed the line under /* Previous page */ from 'oSettings._iRecordsTotal' to 'oSettings._iDisplayStart', which fixed my issue with the prev control not being disabled correctly.