I am trying to add a custom filter to angular-DataTables with server side processing, which works perfectly with sorting and built in search of datatables.<
You can use withFnServerData with fromSource functions instead of withOption:
This API allows you to override the default function to retrieve the data (which is
$.getJSON
according to DataTables documentation) to something more suitable for you application.It's mainly used for Datatables v1.9.4. See DataTable documentation.
$scope.dtOptions = DTOptionsBuilder.fromSource('data.json')
.withFnServerData(serverData);
function serverData (sSource, aoData, fnCallback, oSettings) {
oSettings.jqXHR = $.ajax({
'dataType': 'json',
'type': 'POST',
'url': sSource,
'data': aoData,
'success': fnCallback
});
:)