using datatable api order(0, "asc").draw() show sort icon
using datatable api order(0, "asc").draw() show sort icon
yu yen kan
Posts: 65Questions: 31Answers: 0
I am setting the column with orderable false and class no-sort, but when I execute datatable api for ordering, the sorting icon is appear and the header become strange
Answers
We would really need to see your issue to be able to understand/debug the issue. It's working as expected in this example. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.
Colin
This is the wrong syntax for the
order()
API. The API expects an array with the column and direction. See the docs for details. You will want something more like this:Kevin
https://live.datatables.net/famefego/1/edit
check the example, even I disabled ordering on the table column name and position, when I order with name programmatically, the sorting icon is still showing, so I cant make my own sorting icon..
Setting
columns.orderable
to false only turns off ordering of the column by the end user. The sorting icons will show if the table is ordered by that column. By default Datatables orders the table by column 0. You can useorder
to change the default order to a different column or not initially order the table withorder: []
, like this:https://live.datatables.net/sobujufa/1/edit
Are you wanting to sort by column 0 but not show the sorting icon?
Kevin
https://datatables.net/forums/discussion/77254/rowspan-on-table#latest
this is what I am trying to do, I want to make sorting for both top and bottom header when using rowspan, so I am trying to hide existing sort icon and do my own sort icon with datatable ordering feature.
As I noted in your other thread,
rowspan
is not possible in DataTable'stbody
at this time. Sorry.Allan