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
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.
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:
table.order( [0, "asc"] ).draw();
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 use order to change the default order to a different column or not initially order the table with order: , like this:
Are you wanting to sort by column 0 but not show the sorting icon?
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's tbody at this time. Sorry.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.