The only thing that comes to mind is to put your sort data into the database so you have something to sort on. If it is a single user app then it's easy - add a new column called sortid and put your custom sort order their.
Multi user needs a second table to join on which might mess with smart grid. If you are not trying to display a lot of data you could make a copy of the table in memory using your order and give that to smart grid. You can also modify (for that one call) the actual table. I am not sure how that works for adding fields though. Perhaps you could add a field and put your data in. It might magically disappear after the function closes. Or you could drop the field manually if it didn't. On Fri, 19 Jun 2020, 1:38 am rāma, <ranjeev...@gmail.com> wrote: > Hi all, > > How to sort a smartgrid with your own custom sorted id list? > > Say I have a id list of the query and I have a sorting functions that > returns a sorted id list, how would I make smartgrid to commit to the > ordering instead of sorting by ids by default? > > Thanks, > rama > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/web2py/a078772b-0d41-4993-8df7-b9e5c223e9d0o%40googlegroups.com > <https://groups.google.com/d/msgid/web2py/a078772b-0d41-4993-8df7-b9e5c223e9d0o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CACWMBMNfsc09AH%2Br2YbXe6%3DL86C7TTiKxyzaRx41153En7hy%3Dw%40mail.gmail.com.