Re: [web2py] Re: grid export button

2012-10-27 Thread Santiago AvendaƱo
Maybe original_export_menu is None. You have to verify this before call .elements('a') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') if original_export_menu : export_menu_links = original_export_menu.elements('a') But, if original_export_menu is None, this i

[web2py] Re: grid export button

2012-10-25 Thread Omi Chiba
It worked!! Thanks again. On Thursday, October 25, 2012 10:49:15 AM UTC-5, Paolo Caruccio wrote: > > This happens because the url has arguments. > > please try with: > > {{extend 'layout.html'}} > {{ > if not request.args: > w2p_grid_tbl = grid.element('table') > if w2p_grid_tbl: > original_exp

[web2py] Re: grid export button

2012-10-25 Thread Paolo Caruccio
This happens because the url has arguments. please try with: {{extend 'layout.html'}} {{ if not request.args: w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_it

[web2py] Re: grid export button

2012-10-25 Thread Omi Chiba
I posted on this on my blog and someone pointed that it will get ticket when clicking View button. Do you know how to fix? Problem looks like here. export_menu_links = ori

[web2py] Re: grid export button

2012-10-22 Thread Paolo Caruccio
My fault. I extrapoled the code from more complex one. Try this: {{extend 'layout.html'}} {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: original_export_menu = grid.element('div.w2p_export_menu') export_menu_links = original_export_menu.elements('a') export_menu_items = [] for link

[web2py] Re: grid export button

2012-10-22 Thread Omi Chiba
Wow! This is exactly what I wanted. I hope this will be the default layout for grid. I copy and pasted your code between {{extend 'layout.html'}} and {{=gird}}, then export labels are now disappeard... Maybe you should check your code with the latest (2.1.1). {{left_sidebar_enabled,right_sideb

[web2py] Re: grid export button

2012-10-22 Thread Paolo Caruccio
For grid export menu I'm happy with below method In the views/*.html file where is your grid put on top (just below extend layout command) the following code: {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_