Datatables 1.10 beta-2 + 1.9.4 / Pagination not working

Datatables 1.10 beta-2 + 1.9.4 / Pagination not working

kevou84kevou84 Posts: 9Questions: 1Answers: 0
edited April 2014 in General
Hey Allan,

I wanted to be an early adopter of the next to be released 1.10.
I refactored my code to include jEditable but it's quite similar to what used to work with 1.9, in other terms i'm not new to DT :)
So here I go posting my DT script, wondering why pagination won't work with this one...

Context :
Listing translation innerjoined with translations tokens.
Number of total translations and filtered ones is correct as shown below :
[quote]Showing 1 to 10 of 10 entries (filtered from 12 total entries)[/quote]
But pagination shows only one page where a second page is expected for the 2 more translations.
[quote]First Previous 1 Next Last[/quote]

Code:
[code]
var oTable = jQuery('#dyntable').dataTable( {
"bAutoWidth": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "{{ path('translations_list') }}",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "table_id", "value": "dyntable" } );
},
"sServerMethod": "POST",
"sPaginationType": "full_numbers",
"oSearch": {"bRegex": true},
"aaSorting": [[1,'asc']],
"aoColumnDefs": [
{ "bSearchable": false, "aTargets": [ 0, -1 ] },
{ "bSortable": false, "aTargets": [ 0, -1 ] }
],
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
/* ... */
},
"fnDrawCallback": function () {
/* Apply the jEditable handlers to the table */
jQuery('td.editable', this.fnGetNodes()).editable("{{ path('translations_edit') }}", {
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
indicator : '',
tooltip : 'Click to edit...',
"data": function(value, settings) {
/* Convert
to newline. */
var retval = value.replace(//gi, '\n');
return retval;
},
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "14px"
});
}
});
[/code]

Something I'm missing here with 1.10 ? Or is it a know issue ?

Thanks for your time and consideration.

Kev.

Replies

  • kevou84kevou84 Posts: 9Questions: 1Answers: 0
    edited April 2014
    It seems the problem occurred in the past releases :
    http://www.datatables.net/forums/discussion/2080/data-tables-paginate-bug/p1

    Also, the same code doesn't work with 1.9.4 so it doesn't seem related to 1.10.
    I'm thinking I'm doing something wrong but it really doesn't seem so...

    Debug code : usotak
  • kevou84kevou84 Posts: 9Questions: 1Answers: 0
    edited April 2014
    OK, certainly comes from iTotalDisplayRecords.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Not sure I agree with the fact that this is a bug. I'm not aware of any bugs in the pagination at the moment.

    Can you please link to a test case showing the issue (as required in the forum rules) so I can take a look and offer some help.

    Allan
This discussion has been closed.