Dt Simple Sort Columns
Dt Simple Sort Columns
jdadwilson
Posts: 127Questions: 30Answers: 1
I use the following columns structure throughout my site.
columns: [{ data: 'chu_Name', className: 'udatal', orderable: true, visible: true },
{ data: 'twn_Name', className: 'udatal', orderable: true, visible: true },
{ data: 'chu_Lat', className: 'udatar', orderable: false, visible: true },
{ data: 'chu_Lon', className: 'udatar', orderable: false, visible: true },
{ data: 'chu_Id', className: 'udatar', orderable: false, visible: false}],
Works great with v1.0. Table columns sort as needed. With v2.0 the table displays and basically functions as desired, BUT the columns will not sort and there are no triangles showing. An inspection shows the following for the first thead tr th cell.
<th data-dt-column="0" class="udatal dt-orderable-none" rowspan="1" colspan="1">
<span class="dt-column-title">Church Name</span><span class="dt-column-order"></span></th>
How do I change the columns definition to work with v2.0.8?
As always, TIA for any assistance
jdadwilson
This question has an accepted answers - jump to answer
Answers
It seems to be working as expected here - the first three columns are orderable, the last three aren't.
Could you look at that, please, and see if it helps. It would be interesting to understand the differences.
Colin
I suppose you meant 'first TWO columns' not 'first THREE columns'.
Here are two links to illustrate the difference.
This page uses v1.0. Table heading includes triangles and sorting works.
www.msholmes.org/churches
This page uses v2.0. Table does not include triangles and sorting doesn't work.
www.txgrayson.org/churches
Both use the same table initialization parameters.
So, what do I need to do to make v2.0 sort?
jdadwilson
In
datatables-globals.js
you have disabledordering
in the default settings:EDIT: Either remove it from the defautls or if you want that as the default then set
ordering
to true in the specific Datatable.Kevin
https://www.txgrayson.org/java/vendor/datatables-globals.js
ordering: false,
https://www.txgrayson.org/java/churches.js
set ordering: true,
Not that I can see:
Allan
Thanks... setting orderable: true in the defaults made it work.
jdadwilson