Found a kludge.
# Fix the lack of space between the checkbox and the label.
# The ' ' below is not a space but chr(255).
rows_lst = [(key, ' ' + value) for key, value in rows_lst]
quarta-feira, 20 de Março de 2019 às 09:30:08 UTC, João Matos escreveu:
>
> Hello,
>
> When creating a SQLFORM with checkboxes, they are shown without a space
> between the checkbox and the label.
> The correct behavior would be to have a space, like it happens with the
> Delete checkbox on
> record edit.
>
> This is how it looks
>
>
> [image: Checkboxes.png]
>
> This is my code
>
> ...
> field = Field(
> opt_cat.name_en.translate(''.maketrans(*translation_table
> )).replace(
> '__', '_').replace('__', '_').lower(),
> widget=SQLFORM.widgets.checkboxes.widget,
> requires=IS_EMPTY_OR(IS_IN_SET(rows_dic)),
> )
>
> if T.accepted_language == 'pt':
> field.label = opt_cat.name
> else:
> field.label = opt_cat.name_en
>
> factory_fields.append(field)
>
> form = SQLFORM.factory(*factory_fields,
> buttons=[BUTTON(T('Submit'), _type='submit', _class='btn
> btn-primary')],
> )
>
>
>
>
>
>
> If even tried replacing
>
> opt_cat.name_en.translate(''.maketrans(*translation_table
> )).replace(
> '__', '_').replace('__', '_').lower(),
>
>
> with a simple string, but with the same result.
>
>
> Windows 7 Pro x64 SP1+all updates
> web2py 2.18.4
> Firefox 65.0.2 x64
> Python 3.71. x86
>
> Thanks,
>
> JM
>
>
--
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.