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_bodiguillaume_bodi Posts: 1Questions: 0Answers: 0
edited May 2013 in Bug reports
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]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Thanks for posting this. I'll look into it further.

    Allan
  • voikestervoikester Posts: 2Questions: 0Answers: 0
    Hey Allan,

    I had the same issue, did you look into it?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Not had a chance yet - sorry. It is bookmarked so I'll look at it while updating the Bootstrap examples.

    Allan
This discussion has been closed.