Sort and Search not working
Sort and Search not working
Hi All.
This is my first time using DataTables and I'm not sure what is happening. The table displays fine, but for some reason I cannot get the search and sort to work. I click the sorting icons and nothing happens. I am not sure if I am supposed to set something that I'm missing. Please advise.
Here is my call to the datatable
$('#laborders').dataTable({
"bProcessing": true,
"bAutoWidth": false,
"bServerSide": true,
"bJQueryUI": true,
"sAjaxSource": "/service/",
"aoColumns": [
{ "mDataProp": "LabNumber" },
{ "mDataProp": "DateClosed" },
{ "mDataProp": "ConsumerFName" },
{ "mDataProp": "ConsumerLName" }
]
});
Here is the dumming json what my service is returning
{"iTotalRecords":3,"iTotalDisplayRecords":10,"aaData":[{"DT_RowId":"1","LabNumber":"12345","DateClosed":"2012-02-21","ConsumerFName":"John","ConsumerLName":"Smith"},{"DT_RowId":"2","LabNumber":"123456","DateClosed":"2012-02-21","ConsumerFName":"John","ConsumerLName":"Smith"},{"DT_RowId":"3","LabNumber":"1234567","DateClosed":"2012-02-29","ConsumerFName":John,"ConsumerLName":Smith}]}
Any insight would be greatly appreciated. Thanks.
Derrick
This is my first time using DataTables and I'm not sure what is happening. The table displays fine, but for some reason I cannot get the search and sort to work. I click the sorting icons and nothing happens. I am not sure if I am supposed to set something that I'm missing. Please advise.
Here is my call to the datatable
$('#laborders').dataTable({
"bProcessing": true,
"bAutoWidth": false,
"bServerSide": true,
"bJQueryUI": true,
"sAjaxSource": "/service/",
"aoColumns": [
{ "mDataProp": "LabNumber" },
{ "mDataProp": "DateClosed" },
{ "mDataProp": "ConsumerFName" },
{ "mDataProp": "ConsumerLName" }
]
});
Here is the dumming json what my service is returning
{"iTotalRecords":3,"iTotalDisplayRecords":10,"aaData":[{"DT_RowId":"1","LabNumber":"12345","DateClosed":"2012-02-21","ConsumerFName":"John","ConsumerLName":"Smith"},{"DT_RowId":"2","LabNumber":"123456","DateClosed":"2012-02-21","ConsumerFName":"John","ConsumerLName":"Smith"},{"DT_RowId":"3","LabNumber":"1234567","DateClosed":"2012-02-29","ConsumerFName":John,"ConsumerLName":Smith}]}
Any insight would be greatly appreciated. Thanks.
Derrick
This discussion has been closed.
Replies
> "bServerSide": true,
Since you are using server-side processing, all filtering and sorting must be done by the server. So I guess the question is, have your server-side script implemented that ( http://datatables.net/usage/server-side )?
Allan
Derrick