columns.orderData
columns.orderData
krutovdl
Posts: 51Questions: 9Answers: 1
I recently used this sorting feature and it is a very useful function indeed. However, the only way to reference another column is by its index number such as orderData: [0]. Instead of using the column index number, is there a way to use the actual column name like orderData: ["Column1"] for readability reasons?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The
columns.orderData
state that it expects integer indexes. Using a name won't work. You could create a varColumn1
and assign it the column index and useorderData: [Column1]
.You may be interested in this other thread from today. The developers can comment if they are looking at doing something similar with
columns.orderData
.Kevin
order: [['Column1:name', 'asc']] because my employer is requiring me to use DataTables() rather than dataTables().
Te be consistent, i would expect an overload function to exist for orderData that expects a string array parameter and converts it to an integer array. Then would work as it currently does which just expects an integer array.