I am using Datatables plugin with server-side processing. My table is initiated on a button press. I want to apply a filter to couple of columns on the table when it is actually initialized. I tried using searchCols, but no result. My code is as follows:
var table = dataTables.create("#projectTable", parameters, {
ajax: {
url: 'project/search.do',
data: function(d) {
d.numberOfColumns = 6
d.startDate = jQuery("#start").val(),
d.endDate = jQuery("#end").val()
},
dataSrc: "rows",
type: 'GET'
},
columns: getColumns(),
"columnDefs": getColumnDefs(),
searchCols: [
null,
{ sSearch: jQuery("#selectBox1").val() },
{ sSearch: jQuery("#selectBox2").val() },
null,
null,
null
]
});
}
For now, I am using the column.search.draw() which is making the table to load again ruining the performance of my application. Any help is appreciated!


searchinstead ofsSearch? Unless this is an older version or something