I'm using DataTables plugin. I don't want to use the sorting option (to sort the columns in ASC or DESC order) which comes by default on each <thead>
. How can I remove that sorting icon?
相关问题
- jQuery DataTable - Search a column of dropdowns
- jQuery Plugin to simulate browser page zoom/text z
- Uncaught TypeError: undefined is not a function fo
- Avoid Rendering “No Data Available in the table” i
- datatables initialize table after button click (aj
相关文章
- DataTable : How to hide table header?
- Selecting all visible rows after a search using
- How to add a class to a new row in a jquery datata
- jQuery Datatables - how to programatically sort by
- autocomplete showing self.element.propAttr error
- comma separated auto complete with jquery auto com
- jstree checkbox checked on load
- Is it possible to implement a circular/infinite ca
If you want to disable the default sorting but keep the columns sortable, just use the following configuration :
Ok, so, the answers here are a bit old. So I thought I could provide e newer answer:
source documentation
As of 2018, the way to achieve this, per field, is:
As you can see, targets accepts an array of column indexes.
Very similar to @ravisolanki07 , it's just a different way to achieve this.
In the new version 1.10 of jQuery DataTables you must use
ordering
option to disable ordering on the entire table:Using the
aoColumns
attribute, sorting a specific column can be easily controlled. An example is given bellow:There are 2 things I can think of that you can try.
First, try setting "bSort" to false. Note that this will disable sorting all around, so there is no need to disable it on individual columns.
$('#jTable').dataTable({ "bSort" : false } );
Second, try setting aaSorting to empty. Note that this would be good to try if you still want to allow some other column(s) to be sortable.
$('#jTable').dataTable({ "aaSorting" : [[]] });
Let us know if either works for you. Hope it helps,
Kashif Solangi