Using Editor to Order by
Using Editor to Order by
Loren Maxwell
Posts: 464Questions: 113Answers: 10
in Editor
There must be an example of this but I can't seem to find it.
I want to return a record set already ordered through SQL and disable the ordering on a table.
I know how to disable ordering on a table, but how do I add something like ->order('field_name') to the Editor?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Actually no - the Editor libraries assume that either client-side or server-side processing will be used to do the sorting of the data, so it doesn't provide a way to specify an SQL
order byfor the table as a whole.One option to get around that would be to use a
VIEWwhere you can specify an order and then just let the Editor librariesSELECTfrom that view.Allan
Just wanted to follow up. I used the query object to get the sort that I wanted.
Only drawback is that the table doesn't reorder when I edit or add a new entry, which is a relatively minor issue for me. When the page refreshes it's correct.
Anyway, here's my code if anyone else is looking to do the same: