Grid search and clear buttons don't restore request.args. Where can I correct that?

26 views
Skip to first unread message

jcrm...@gmail.com

unread,
Apr 29, 2019, 6:15:30 PM4/29/19
to web2py-users

Grid search and clear buttons don't restore request.args. Where can I correct that?


If using master-child pages, the master grid search works fine (because there are no request.args), but the child grid (which has request.args, from the master record) doesn't because the search and clear buttons don't restore the request.args.


web2py 2.18.5
Python 3.7.1 x86
Firefox 66.0.3 x64
Windows 7 Pro x64 SP1+all upds

Anthony

unread,
Apr 29, 2019, 7:37:24 PM4/29/19
to web2py-users
What do you mean by master-child pages? Are you using smartgrid? Can you show some code?

jcrm...@gmail.com

unread,
Apr 30, 2019, 4:58:28 AM4/30/19
to web2py-users
I have a master page (in this case an equipment's grid) where I have links to child tables.
The URL for the equipment's page is
http://jmatos-p:8000/equipment?search=1&sid=d4b3d39a-b6bc-4c41-af05-d2e9bf7ea195

In this page the search and clear search buttons work fine and show the correct URLs, but this page doesn't have args.

When I go to one of the child's page (using the grid link) I have the below URL. Every child page contains a grid with the child's table records.
http://jmatos-p:8000/single_equip/index/11?search=1&sid=d4b3d39a-b6bc-4c41-af05-d2e9bf7ea195

The URL after pressing the search button is changed to (the args are gone and this is the problem)
http://jmatos-p:8000/single_equip?keywords=equip_ps.ps_id+%3D+%224%22&sid=d4b3d39a-b6bc-4c41-af05-d2e9bf7ea195

The URL after pressing clear search button is changed to (the args are gone and this is the problem)
http://jmatos-p:8000/single_equip?keywords=&sid=d4b3d39a-b6bc-4c41-af05-d2e9bf7ea195

The search and clear search actions work fine. The problem is only the URLs they construct that are missing the args.
Message has been deleted

jcrm...@gmail.com

unread,
Apr 30, 2019, 1:38:24 PM4/30/19
to web2py-users
Found the solution.

I have to add
args=request.args[:1],
to the child grid.

terça-feira, 30 de Abril de 2019 às 00:37:24 UTC+1, Anthony escreveu:
Reply all
Reply to author
Forward
0 new messages