Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82218

Datatables 1.10 beta-2 + 1.9.4 / Pagination not working

$
0
0
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 :
Showing 1 to 10 of 10 entries (filtered from 12 total entries)
But pagination shows only one page where a second page is expected for the 2 more translations.
First Previous 1 Next Last

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 : '<center><img src="/images/loaders/loader1.gif"></center>',
                    tooltip   : 'Click to edit...',
                    "data": function(value, settings) {
                        /* Convert <br> to newline. */
                        var retval = value.replace(/<br[\s\/]?>/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"
                });
            }
	});

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

Thanks for your time and consideration.

Kev.

Viewing all articles
Browse latest Browse all 82218

Trending Articles