On Sunday, January 19, 2014 9:32:39 AM UTC-5, horridohobbyist wrote:
>
> I'm new to web2py and I'm playing around with SQLFORM.grid. I notice that
> the display of string fields truncates at 20 characters, whereas SQLTABLE
> did not impose such a limit. How do I loosen up this limit?
>
.grid(..., maxtextlength=1000)
or per field:
.grid(..., maxtextlength=1000, maxtextlengths={'mytable.myfield': 10})
FYI, by default, SQLTABLE truncates at 16 characters, though that can be
overridden globally or per field, as with the grid.
Also, while I can disable exportclasses, I can't get rid of the "Export:"
> label beneath the grid. I would think that something like
> "exportclasses=None" would eliminate everything to do with export.
> Altogether, this is not very intuitive.
>
.grid(..., csv=False)
> And finally, if I specify the fields to be fetched from the database
> (using "fields="), I would think that the excluded fields (for example,
> 'Id') wouldn't show up in the Search field dropdown. How would the user
> ever know what 'Id', for example, to search for?
>
db.mytable.id.readable = False
You can also use your own custom search query builder and widget via:
.grid(..., searchable=my_query_builder, search_widget=my_widget)
SQLFORM.grid could be a bit more flexible.
>
If you have ideas for further flexibility, feel free to submit a pull
request.
Anthony
--
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/groups/opt_out.