Hi there,
I would like to implement a custom checkboxes widget where I can control
the rendering in the template similar to the other custom form widgets. In
the controller I would like to define the checkboxes widget as usual with
an array of choices like:
choices = [(1, 'first'), (2, 'second'), (3, 'third')]
form = SQLFORM.factory(
Field('selection',requires=IS_IN_SET(choices),
widget=SQLFORM.widgets.checkboxes.widget)
so I can use the built-in validations. However in the view I would like to
have fine-grained control over the placement of the individual items like:
please choose:
<div>{{=form.custom.widget.selection.1}}</div>
someotherhtmlhere
<div>{{=form.custom.widget.selection.2}}</div>
morehtmlgoeshere
<div>{{=form.custom.widget.selection.3}}</div>
or some other syntax for achieving the same goal. How can I implement this
and where do I start?
Thanks for your help
ofr