Change ajax source after initial load.

Change ajax source after initial load.

pjpspjps Posts: 5Questions: 0Answers: 0
edited January 2014 in General
I have the table working with paging and filtering, but I also want to bind to an event somewhere on the page (a click or whatever) that would change the ajax source and reinitialize the table.

I'm using this basically

[code]
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../examples_support/server_processing.php"
} );
} );
[/code]

Thanks in advance,
PJ

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Can you not just use a simple jQuery event? `$('#myButton').on( 'click', function () {...} );` and use fnDestroy to kill the old table before initialising a new one?

    Allan
  • pjpspjps Posts: 5Questions: 0Answers: 0
    The fnDestroy is what I was after, the event binding etc I can deal with. Thanks! :-)
This discussion has been closed.