Determine if a DataTable has ajax functionality configured ?
Determine if a DataTable has ajax functionality configured ?
in DataTables
Hi,
I have a piece of code that handles different DataTables.
I'd like it to behave differently if a DataTable has ajax functionality enabled, or not.
For example I'd send an .ajax.reload() to a DataTable that can handle it, or just clear it if it doesnt have ajax configured in its initialization settings.
So, is there a way to determine if a DataTable has ajax functionality ?
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @Nite01 ,
The
init()api method might do what you want here. It returns the object that was used to initialise the table so you can check that.Thanks,
Sandy
You could call
ajax.json()- this returns the last JSON received. If that isundefined, you can safely assume the table isn't using JSON.Colin