The default/index.html view exists (the default "simple app" one), so it's not clear to me why it is using generic.html.

The index() function does not explicitly define any other variables, but the "grid:" is displayed even if the index() function returns dict(grid=grid).

On Tue, 24 Sep 2013, Anthony wrote:

It looks like you have not created a view for this function, so the 
generic.html view is being used instead. When you return multiple variables, 
the generic view displays the name of
each variable. Since you are returning locals(), I assume you must have defined 
other variables in the index() function in addition to grid -- if grid were the 
only variable defined,
the generic view would not show the "grid:" label.
As an alternative, you can either create a custom view (recommended), or just 
return the grid variable (i.e., return dict(grid=grid)).

Anthony
On Tuesday, September 24, 2013 12:04:30 PM UTC-4, wb wrote:
      On both 2.5.1 and 2.6.4, grids are rendered with the name of the
      variable visible.  For example:

      def index():
           grid = SQLFORM.grid(db.names,
               fields = [db.names.lastname, db.names.firstname])
           return locals()

      On screen, this renders (roughly) as:

         grid : _________ Search Clear


      That "grid" is the name of the form variable, and it's really not doing
      anything useful.  The book examples do not show it, so maybe it's
      something new or I've broken the CSS somehow.  Can it be removed?

--
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.
For more options, visit https://groups.google.com/groups/opt_out.



--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to