Unable to allow user sort after specifying sTypes in aoColumns
Unable to allow user sort after specifying sTypes in aoColumns
Exactly as the title says. I have a Datatable that's rendering from an HTML table. In the initial dataTables call, I'm specifying:
[code]"aoColumns": [{"sType": "numeric"}, null][/code]
on a two-column table. The first column is a number(Integer) but I'm using EL to render it(${id}). Before it was sorting them as a String(so 10, 100 came before 20, when it should be 10, 20, 100). Now that I add the above string, it sorts it properly initially, but when I click the header to have it sort(by descending instead of ascending) it doesn't allow the column with the changed sType to be sorted.
The numbers are Raw integers, no formatting and no ,'s or .' to worry about, just 1234.
Any idea or help?
[code]"aoColumns": [{"sType": "numeric"}, null][/code]
on a two-column table. The first column is a number(Integer) but I'm using EL to render it(${id}). Before it was sorting them as a String(so 10, 100 came before 20, when it should be 10, 20, 100). Now that I add the above string, it sorts it properly initially, but when I click the header to have it sort(by descending instead of ascending) it doesn't allow the column with the changed sType to be sorted.
The numbers are Raw integers, no formatting and no ,'s or .' to worry about, just 1234.
Any idea or help?
This discussion has been closed.
Replies
Allan
The site is internal so I'm unable to share it, but all the data is numbers in that column. From what I've seen before, EL has problems with Numbers so it's really printing them out and that's it, I don't know if they are true and proper Integer classes, and it's going into an HTML , but I can verify that everything in the column is a valid integer.
[code]
1
[/code]
instead of like:
[code]
1
[/code]
It caused dataTables to not see it properly I guess, because as soon as I did it as example 2 here, it sorted it properly.
Thanks,
Allan
Allan
Allan