0

I am using datatable to show my data in a table and my code is like this:

$('#data_table').DataTable(data);

Right now i want to apply the properties "order": [] to the data table. I already tried below option but not working.

$('#data_table').DataTable( {
"order": [],
data:data,
} );
3
  • What is not working? what are the errors you are getting? Which version of datatables are you using? Could you explain your question a bit further? Commented Jun 9, 2017 at 6:10
  • I am using version DataTables 1.10.13 and the result showing No data available in table. Commented Jun 9, 2017 at 6:12
  • @SahanSerasinghe Here is the screenshot of the result i am getting.screencast.com/t/UevBAZrNwM2s but when i am using $('#data_table').DataTable(data); the table is coming fine with data Commented Jun 9, 2017 at 6:19

1 Answer 1

0

You have to specify which columns you need to apply ordering and what order(asc or desc)

"order": [[ 0, "asc" ]], where 0 is for first column

in case you need more its

"order": [[ 0, "asc" ],[1 , "asc"]]
Sign up to request clarification or add additional context in comments.

1 Comment

I was looking to implement the following option.stackoverflow.com/questions/4964388/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.