shows the first pagination even though the second pagination is selected

shows the first pagination even though the second pagination is selected

jesperdjesperd Posts: 0Questions: 0Answers: 0
edited February 2012 in General
Hi,

I have this code on my webpage:

[code]

// http://datatables.net/plug-ins/api#fnSetFilteringDelay
$j.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
/* Version: 2.1.0 */
var _that = this;
this.each( function ( i ) {
$.fn.dataTableExt.iApiIndex = i;
iDelay = (iDelay && (/^[0-9]+$/.test(iDelay))) ? iDelay : 250;

var $this = this, oTimerId;
var anControl = $( 'input', _that.fnSettings().aanFeatures.f );

anControl.unbind( 'keyup' ).bind( 'keyup', function() {
// var $$this = $this;

if (typeof(sPreviousSearch) == 'undefined' || sPreviousSearch === null || sPreviousSearch != anControl.val())
{
window.clearTimeout(oTimerId);

oTimerId = window.setTimeout(function() {
$.fn.dataTableExt.iApiIndex = i;
_that.fnFilter( anControl.val() );
}, iDelay);
}
});

return this;
} );
return this;
}



var instances;
$j(document).ready(function() {
instances = $j('#instances').dataTable( {
"bStateSave": true,
"iCookieDuration": 3600,
"aoColumns": [null, null, null],
"bProcessing": true,
"bServerSide": true,
"bAutoWidth": false,
"sPaginationType": "full_numbers",
"sAjaxSource": "ajax/elements_index.php",
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$j('td:eq(0)', nRow).html($j('').attr('href', 'edit.php?id='+aData[0]).html(aData[0]));
if (!aData[1]) {
$j('td:eq(1)', nRow).html(' ');
} else {
$j('td:eq(1)', nRow).html($j('').attr('href', 'edit.php?id='+aData[0]).html(aData[1]));
};
return nRow;
},

"fnServerData": function ( sSource, aoData, fnCallback ) {
// http://datatables.net/1.5-beta/examples/server_side/custom_vars.html
aoData.push( { "name": "egid", "value": "<?php echo $egid ?>"});
$j.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json)
});
}

});
instances.fnSetFilteringDelay();
});
[/code]

As you can see, I have set bStateSave to true, so the state is saved. When leave the page and later returns to the page, the table is loaded with the settings from the cookie, but instead of showing the last current pagination it always shows the first pagination. The funny is that in the bottom of the table view where you select the next pagination, the last current pagination number is correct selected.

Any idea of why the first pagination is always displayed?
This discussion has been closed.