Datatable is a great tool which I have adopted in my current project. I have the below datatable initialized. I cannot use bServerside because i dont have thead defined in my jsp which comes from below ajax call. So how I can catch sort and filter events and forward it to ajax call and refresh the datatable.
$.ajax( {
"dataType": 'text',
"type": "GET",
"url": "ajaxUnreconciledListSearch.do",
"success": function (dataStr) {
data = eval( '('+dataStr+')' );
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sDom":'<"H"lr>t<"F"ip>',
"aaData": data.aaData,
"aoColumns": data.aoColumns,
"aaSorting": [[0, "desc"]],
"sPaginationType" : "full_numbers",
"aoColumnDefs": data.aoColumnDefs
});
oTable.columnFilter({
sPlaceHolder: "head:before",
aoColumns: data.aoColumnsFilter
});
}
} );
$.ajax( {
"dataType": 'text',
"type": "GET",
"url": "ajaxUnreconciledListSearch.do",
"success": function (dataStr) {
data = eval( '('+dataStr+')' );
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sDom":'<"H"lr>t<"F"ip>',
"aaData": data.aaData,
"aoColumns": data.aoColumns,
"aaSorting": [[0, "desc"]],
"sPaginationType" : "full_numbers",
"aoColumnDefs": data.aoColumnDefs
});
oTable.columnFilter({
sPlaceHolder: "head:before",
aoColumns: data.aoColumnsFilter
});
}
} );