Determine if a DataTable has ajax functionality configured ?

Determine if a DataTable has ajax functionality configured ?

Nite01Nite01 Posts: 1Questions: 1Answers: 0

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

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    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

  • colincolin Posts: 15,146Questions: 1Answers: 2,586
    Answer ✓

    You could call ajax.json() - this returns the last JSON received. If that is undefined, you can safely assume the table isn't using JSON.

    Colin

Sign In or Register to comment.