How to change '_class' of Web2py autocomplete widget

血红的双手。 提交于 2019-12-04 21:53:47

The autocomplete widget is a TAG object that contains two components, the first of which is the INPUT element. So, do something like:

if p == 'subject':
    form.custom.widget[p][0].add_class(classes)

Note, you can use the add_class method to add classes to an element that has an existing class.

Also, instead of manually changing all the classes, you might see if setting crud.settings.formstyle to "bootstrap3_stacked" or "bootstrap3_inline" works for you. If not, you can also write a custom formstyle function to generate the exact form layout you want.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!