Problem fnDraw false pagination datatable
Problem fnDraw false pagination datatable
ardnaxela03
Posts: 3Questions: 0Answers: 0
Hello everybody,
I have a problem with my pagination it is resetting when I use fnDraw in fnDrawCallback, I have jquery.dataTables.min.js version 1.8.2 my variable bProcessing is true and bServerSide is true, I have sAjaxSource with my ajax path and the function fnDrawCallback is
function(){
$(oTable.fnGetNodes()).find("td [class='edit']").editable('url/update',{
'submitdata': function ( value, settings ) {
return {
'id': oTable.fnGetData( this.parentNode )[0], // get the value of first row/column. id COLUMN
'columnId': oTable.fnGetPosition( this )[2] // Column number
};
},
'callback': function( sValue, y ) {
/* Redraw the table from the new data on the server */
oTable.fnDraw(false);
},
'fnShowError': function (message, action) {
alert(message);
}
} );
}
I tried to use fnStandingRedraw also but doesn't work, please help me!!
I have a problem with my pagination it is resetting when I use fnDraw in fnDrawCallback, I have jquery.dataTables.min.js version 1.8.2 my variable bProcessing is true and bServerSide is true, I have sAjaxSource with my ajax path and the function fnDrawCallback is
function(){
$(oTable.fnGetNodes()).find("td [class='edit']").editable('url/update',{
'submitdata': function ( value, settings ) {
return {
'id': oTable.fnGetData( this.parentNode )[0], // get the value of first row/column. id COLUMN
'columnId': oTable.fnGetPosition( this )[2] // Column number
};
},
'callback': function( sValue, y ) {
/* Redraw the table from the new data on the server */
oTable.fnDraw(false);
},
'fnShowError': function (message, action) {
alert(message);
}
} );
}
I tried to use fnStandingRedraw also but doesn't work, please help me!!
This discussion has been closed.
Replies
fnDraw doesn't keep pagination state.
Use _fnAjaxUpdate instead of fnDraw like this:
[code]table._fnAjaxUpdate(table.oSettings);[/code]
Also set [code]"bStateSave": true[/code] in table's initialization.
Just keep in mind that _fnAjaxUpdate is an internal function. From http://datatables.net/docs/DataTables/1.9.0/34cdb56b2c.html
[quote]Note that these methods are references to internal functions and are considered to be private. If you use these methods, be aware that they are liable to change between versions (check the upgrade notes).[/quote]