Disable On Load Ajax Call In Datatable
Disable On Load Ajax Call In Datatable
I am using DataTables 1.10.11 in my project to display some user data on the Page. I am Loading the table data from the server using Ajax call. My data table working fine without any issue. My Datatable:
$("#user_table").DataTable({
"destroy": true,
"order": [],
dom: "Bfrtip",
"bProcessing": false,
"bServerSide": false,
"searching": false,
"pageLength": 7,
"autoWidth": false,
"bAutoWidth": false, // Disable the auto width calculation
"sort": "position",
"stateSave": true,
"ajax": {
url: "Url/data",
type: "GET",
dataSrc: function (json) {
$('#user_profile_box div.overlay').fadeOut();
return json;
}
}
});
I don't want to load my datatable content from server on load of the page. I want my table to load if user click on load button. Is there any workaround for this issue??
Thank You!!!
This question has an accepted answers - jump to answer
Answers
Hi @anema ,
Take a look at this example here from a different thread, this demonstrates what you're after,
Cheers,
Colin
Hi Colin,
Hi @anema ,
In that example you need to declare the table twice, but you could create an object that contains the initialisation settings which you then just refer it, something like this,
Cheers,
Colin