I'm trying to reload the ajax data into my Datatables list.
The jQuery code in js file is the following ( semplified )
"use strict";
var KTDatatablesDataSourceAjaxServer = function() {
var initTable1 = function() {
var table = $('#kt_table_1');
// begin first table
table.DataTable({
responsive: true,
searchDelay: 500,
processing: true,
serverSide: true,
ajax: server_url,
});
};
return {
//main function to initiate the module
init: function() {
initTable1();
},
};
}();
jQuery(document).ready(function() {
KTDatatablesDataSourceAjaxServer.init();
});
Usually, Datatable API provide the following code to reload the server data
table.ajax.reload(null,false);
But in my case the code above doesn't work...I get an error of table not defined. Any hint to fix the issue?
Thanks a lot