DataTables ordering
DataTables ordering
hubo
Posts: 45Questions: 14Answers: 0
in Bug reports
When the first item (row) in the table has no value (by which it can decide how to order the column) or data-order attribute, it will order the column as a string.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Please link to a test case showing the issue, per the forum rules.
If you mean that you want to use the
data-order
attribute to provide sorting information, that attribute must be available on all rows.Allan
I am using data-order="" as a workaround for the empty columns. Is it right? Will it compare as a number if the other data-order values are data-order="21", data-order="100"?
That is fine as long as you set the
data-order
attribute for all cells in that column. For efficiency reasons DataTables won't check every row it reads in for attributes that might not exist - hence why the decision to do so is based on the data in the first row.Allan