I am using jQuery DataTables plugin with server side processing in my application. As of now, the table is initialized and loaded with data when the document is ready. The code goes as follows:
jQuery(document).ready(function() {
var table = DataTables.create("#projectTable", parameters, {
ajax: {
url: 'project/search.do',
data: function(d) {
d.numberOfColumns = 6
d.submittedOnStart = jQuery("#date1").val(),
d.submittedOnEnd = jQuery("#date2").val()
},
dataSrc: "rows",
type: 'GET'
},
columns: getColumns(),
"columnDefs": getColumnDefs()
});
});
This is working fine. But, I want to change it in such a way that the table is initialized on document ready, but the data is loaded on button click. I looked into Load DataTable data through button Click which is not working in my case. Is there a way to do this?