fnReloadAjax and bStandingRedraw

fnReloadAjax and bStandingRedraw

blueshirts27blueshirts27 Posts: 4Questions: 0Answers: 0
edited June 2013 in Plug-ins
After reading the following thread I got the impression that I could call the fnReloadAjax plugin method with a third parameter of bStandingRedraw equal to true in order to preserve the table state.

http://datatables.net/forums/discussion/8598/keep-pagination-state-on-fnreloadajax/p1

This didn't work for me, the table was reloaded though the page state was lost. I am using server side processing. I took a look at the fnReloadAjax plugin code and I noticed the following block at the beginning of the method.

[code]
// Server-side processing should just call fnDraw

if ( oSettings.oFeatures.bServerSide ) {
this.fnDraw();
return;
}
[/code]

Seems that when you are using server side processing it will never get to the block of code that references the bStandingRedraw parameter later in the method. Is bStandingRedraw a valid parameter for use with server side processing? I commented out the code block referenced above as a test and the table does seem to reload and retain it's state.

[code]
if ( bStandingRedraw === true )
{
oSettings._iDisplayStart = iStart;
that.oApi._fnCalculateEnd( oSettings );
that.fnDraw( false );
}
[/code]

I apologize if I am missing something though the bStandingRedraw doesn't seem to have any affect in my case.

Replies

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    I don't think fnReloadAjax should really be used at all when you are using server-side processing. Just call fnDraw( false ).

    Allan
This discussion has been closed.