Can the serverSide flag be accessed from the table after creation?
Can the serverSide flag be accessed from the table after creation?

I create a DataTable to use server side processing mode.
var config = {};
...
config.serverSide = true;
config.ajax = { ... };
var table = $( '#person-table' ).DataTable( config );
Later, some function of mine receives a DataTable as an argument. Can I determine if that DataTable is using server side processing mode, by inspecting any of its properties or calling one of its functions? For example:
Util.reloadTable = function ( table )
{
// Reloading only works if the DataTable is using server-side processing mode.
if ( table.something /* ??? */ )
{
table.ajax.reload( null, false );
}
}
This discussion has been closed.
Answers
If the opposite of
serverSide
is data in the DOM and no ajax, then you can callajax.url()
- it'll returnnull
. If you're still using ajax, then callsettings()
- this is considered private but it'll get you what you want:Colin