Loading new data into Data tables

Loading new data into Data tables

kaippallykaippally Posts: 4Questions: 0Answers: 0
edited March 2014 in DataTables 1.9
I have a datatable with data loaded via AJAX

Like this:

$(document).ready(function() {
oTable = $('#snapshot').dataTable( {
'sScrollY': 500,
'bPaginate': false,
'bScrollCollapse': true,
'bJQueryUI': true,
'bStateSave': false,
"bFilter": true,
'bSort': true,
"bAutoWidth": false ,
"sAjaxSource": 'live_vision_data.php'
} );
} );

How do I reload the same ajax source file "live_vision_data.php" with one click?

Replies

  • xilaxxilax Posts: 10Questions: 0Answers: 0
    Make use of fnReloadAjax (do a search on this site for that)

    then you can call as
    var contentTable = $("#contentTable").dataTable( );

    $(document.body).on('click', '#reloadTableData', function(event){
    contentTable.fnReloadAjax();
    event.preventDefault();
    });
  • kaippallykaippally Posts: 4Questions: 0Answers: 0
    Thanks xilax
This discussion has been closed.