I am facing problem using GRID, the results which are displayed in the gird 
are correct as per query but if the number of records are more, then 
results are displayed across multiple pages in the grid. Problem is that 
when, I select second (any other page) to view more results from grid, i 
get the error that "local variable grid is referenced before assignment". 
Can some one please help me on how to resolve this. (I actually have to 
build grid on another page)


*Controller :*
def results():
    query = (db.Products.product_version==request.vars.product_name))
    if request.vars.product_name and request.vars.makers_name:
        grid = 
SQLFORM.grid(query=query,csv=False,create=False,deletable=False,)
    return dict(grid=grid)

*Views:* (results.html)
{{extend 'layout.html'}}
{{=grid}}

*Form:*
{{extend 'layout.html'}}
<form enctype="multipart/form-data" action="default/results" method="post">
<select name='product_name'
...
</select>
<select name='makers_name'
...
</select>
<input type="submit" value='Submit'>
</form>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to