Problem with the search when using two SQLFORM.grid on the same web page

56 views
Skip to first unread message

Yuval

unread,
Apr 18, 2013, 11:19:09 PM4/18/13
to web...@googlegroups.com
I am using two different SQLFORM.grid on the same page. 

Each is based on a different query and tables.

When I enter text and select search on one SQLFORM.grid, the same text is populated and search is executed on the other SQLFORM.grid.

Is there any way to prevent it?

Niphlod

unread,
Apr 19, 2013, 3:20:34 AM4/19/13
to web...@googlegroups.com
this is an excerpt from the book

Because of the way grid works one can only have one grid per controller function, unless they are embedded as components via LOAD. To make the default search grid work in more than one LOADed grid, please use a different formname for each one.

So, 2 steps required:
1. in the page that shows the grids has to have 2 different LOAD(), each one pointing to a single grid
2. use SQLFORM.grid(........, formname='grid1') for one and SQLFORM.grid(........, formname='grid2') for the other

Yuval

unread,
Apr 19, 2013, 3:31:01 AM4/19/13
to web...@googlegroups.com
Great answer, I was not aware of this,
Thank you.
--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/dpJctTl5V3E/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages