Sort and Search not working

Sort and Search not working

dmitradmitra Posts: 6Questions: 0Answers: 0
edited March 2012 in General
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

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi Derrick,

    > "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
  • dmitradmitra Posts: 6Questions: 0Answers: 0
    Ahh I see. Thanks Allan - I commented out bServerSide and all is working as I expected. Thanks for your help!!

    Derrick
This discussion has been closed.