Have you tried the orderby option of the smartgrid?
Example of conctent:
orderby = dict(t_prj_doc_item= [ db.t_prj_doc_item.f_sequence, 
db.t_prj_doc_item.id]),

Le mardi 23 juin 2020 à 00:48:54 UTC+2, roge...@gmail.com a écrit :

> 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, <ranje...@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+un...@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/104d7478-8a5e-4b1b-bc8c-3f035895c343n%40googlegroups.com.

Reply via email to