So, I progressed to being able to successfully create a custom search
widget for SQLFORM.smartgrid . Along the way I discovered that you can
only put one form there (may be I'm wrong, then I would appreciate hints).
As an alternate solution I implemented all fields in a single form, but
decided to separate them by fieldsets like so:
def customSearch(self, url):
# Build a simple form
userId = auth.user_id
userDates =
db(db.work_log.created_by==userId).select(distinct=db.work_log.created_on)
userYears = list(set(str(userDates[i].created_on.year) for i in
range(len(userDates))))
options = [OPTION(userYears[i], _value=str(userYears[i])) for i in
range(len(userYears))]
optionsAdded=options[:]
optionsAdded.insert(0, OPTION('All Records', _value=0))
form = FORM(FIELDSET(TAG.legend("Yearly Report"),
SELECT(_name='year', _id='year', _style='width:150px;',
value=request.get_vars.year, *optionsAdded),
INPUT(_type='submit',_value=T('Yearly Report')),
INPUT(_type='submit',_value=T('Clear'),
_onclick="jQuery('#year').val('');jQuery('#jac_num').val('');"),
_id="yearly_report"),
FIELDSET(TAG.legend("Jacket Search"),
INPUT(_name='jac_num', _id='jac_num', _style='width:150px;',
value=request.get_vars.jac_num),
INPUT(_type='submit', _value=T('Search for Jacket')),
INPUT(_type='submit', _value=T('Clear'),
_onclick="jQuery('#jac_num').val('');jQuery('#year').val('');"),
_id="jacket_search"),
_method="GET",_action='self', _id='contactSearch', formstyle =
'bootstrap')
return form
However the result I get is a separation of fields by heavy headers:
<https://lh3.googleusercontent.com/-FeEF8fQ1LP8/U2pidrCaY3I/AAAAAAAABew/VBspyKIjXII/s1600/fieldset_problem.png>
I found some fieldset formatting in web2py.css but when I disable it, only
minor changes are done to fieldset (font, background, etc). What I'm
looking for is to achieve a default html fieldset look that surrounds
related fields in a thin line with legend that intersects that line like so:
<http://www.webstandards.org/files/accessible-forms/nested-fieldset.gif>
--
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.