>
> But, grid isn't formatted for bootstrap, which I use and the rest of
> web2py supports. This inconsistency causes trouble when I use the
> ui="web2py" argument to grid.
>
The "web2py" ui includes the following CSS classes:
ui = dict(widget='',
header='',
content='',
default='',
cornerall='',
cornertop='',
cornerbottom='',
button='button btn btn-default',
buttontext='buttontext button',
buttonadd='icon plus icon-plus glyphicon
glyphicon-plus',
buttonback='icon leftarrow icon-arrow-left glyphicon
glyphicon-arrow-left',
buttonexport='icon downarrow icon-download glyphicon
glyphicon-download',
buttondelete='icon trash icon-trash glyphicon
glyphicon-trash',
buttonedit='icon pen icon-pencil glyphicon
glyphicon-pencil',
buttontable='icon rightarrow icon-arrow-right
glyphicon glyphicon-arrow-right',
buttonview='icon magnifier icon-zoom-in glyphicon
glyphicon-zoom-in',
)
Which of the above classes are causing problems for your display?
Of course, you can simply provide your own classes by passing a custom
dictionary as the "ui" argument.
One last gripe about grid is the search function. It's powerful, but
> overkill for what I want, which is an autocomplete function than narrows my
> search as I type.
>
You can customize both the search widget displayed on the page as well as
the search function that generates the database query. The former is
handled via the "search_widget" argument, and the latter by providing a
function as the "searchable" argument (it takes the list of searchable
fields and the "keywords" variable from the search form and must return a
Query object).
Note, if you just want a single text box for search, rather than creating a
custom search widget, it might be easier to keep the default widget and
simply disable its Javascript functionality via:
search_input = grid.element('#w2p_directory_keywords')
search_input and search_input.attributes.pop('_onfocus')
You could also handle that via Javascript on the client.
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/d/optout.