I have been integrating datatables with our online application and while I’m overall impressed there are some methods that just won’t work for us, one of which is the sorting of table columns, sadly our sort method is quite tricky and to re-write it would be a coders worst nightmare.
At present on our tables you click the cell header and this then refreshes the page with the new sorted data, my question is how can I override the default method and instead get it to call the specific script? I have tried the AjaxSource method but this isn’t working as expected and it will be hopefully be easier to re-write the sort rather than re-write the 2000 lines of data handling the table script does.
we are creating the datatable at present with the following :
objDataTable = $jq('#table' + TABLETABDATA).dataTable( {
"sScrollY": 520,
"bJQueryUI": true,
"bInfo": false,
"bPaginate": false,
"bScrollCollapse": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": AJAXSOURCE,
"sServerMethod": "POST",
"fnServerParams": function ( aoData ) {
if (extraparams.length > 0)aoData.push( extraparams );
},
"iDeferLoading": 57,
"bSortClasses": false,
"sDom" : '<"H"<"sitedrop">lfr>t<"F"<"excelexport"><"pagination">ip>',
"oLanguage": { "sSearch": "Filter: " }
} );
I changed the call to the following and instead just added the links into the table header rows myself, I believe there is a more elegant way of doing this so if anyone can come up with one?