file-size plugin
file-size plugin
Is it possible to sort multiple columns with the same plugin. For example, I have two columns, size and total and they are in MB,KB,GB and I want to be able to sort them both by that plugin. I tried putting in both but the page only sorts the last one and ignores the previous one.
I had to do this to get it to work for now
"columnDefs": [{
"type": "file-size",
targets: -1
//"type": "file-size",
// targets: -2,
This discussion has been closed.
Answers
A plug-in cannot sort over multiple columns - you would need to use the DataTables API or options (for example
order()
to specify a multi-column sort.It is however quite possible to use the same plug-in for multiple columns, each sorting independently. If that doesn't work for you please link to at test case showing the problem.
Allan