The navigator in the bootstrap extension does not fire 'page' events when a page number is clicked
The navigator in the bootstrap extension does not fire 'page' events when a page number is clicked
guillaume_bodi
Posts: 1Questions: 0Answers: 0
Here is a patch that worked for me.
Note that I'm not too sure if it's safe to overwrite the iDisplayLength property with paging's iLength.
It didn't seem to explode though.
Somebody else might find it useful.
[code]
--- a/public/js/DT_bootstrap.js
+++ b/public/js/DT_bootstrap.js
@@ -84,10 +84,12 @@ $.extend( $.fn.dataTableExt.oPagination, {
sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';
$(''+j+'')
.insertBefore( $('li:last', an[i])[0] )
- .bind('click', function (e) {
+ .bind('click.DT', {action: 1}, function (e) {
e.preventDefault();
- oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength
- fnDraw( oSettings );
+ oSettings._iDisplayLength = oPaging.iLength;
+ if ( oSettings.oApi._fnPageChange(oSettings, (parseInt($('a', this).text(),10)-1)
+ fnDraw( oSettings );
+ }
} );
}
[/code]
Note that I'm not too sure if it's safe to overwrite the iDisplayLength property with paging's iLength.
It didn't seem to explode though.
Somebody else might find it useful.
[code]
--- a/public/js/DT_bootstrap.js
+++ b/public/js/DT_bootstrap.js
@@ -84,10 +84,12 @@ $.extend( $.fn.dataTableExt.oPagination, {
sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';
$(''+j+'')
.insertBefore( $('li:last', an[i])[0] )
- .bind('click', function (e) {
+ .bind('click.DT', {action: 1}, function (e) {
e.preventDefault();
- oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength
- fnDraw( oSettings );
+ oSettings._iDisplayLength = oPaging.iLength;
+ if ( oSettings.oApi._fnPageChange(oSettings, (parseInt($('a', this).text(),10)-1)
+ fnDraw( oSettings );
+ }
} );
}
[/code]
This discussion has been closed.
Replies
Allan
I had the same issue, did you look into it?
Allan