Okay, that makes sense. I do intend to make custom views, even more so
now. For now, default/index.html is just:
{{extend 'layout.html'}}
{{=grid}}
Thanks!
On Tue, 24 Sep 2013, Anthony wrote:
Oops, sorry -- the default/index.html view that comes with the scaffolding app includes
{{=BEAUTIFY(response._vars)}} when there is no "message" or "content" variable
returned, which is
the same thing the generic.html view does when more than one variable is
returned.
Keep in mind that if you want to control the display of your data, you do need
to create customized views. The generic views (including the generic code built
into the default
index.html view) can't know exactly how you would want to display multiple
items returned from the controller.
Anthony
On Tuesday, September 24, 2013 1:41:39 PM UTC-4, wb wrote:
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+un...@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.
--
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.