2014-05-21 1:41 GMT-03:00 weheh <[email protected]>:

> Bootstrap uses some html attributes that won't work with web2py html
> helpers. Is there a way to get web2py helpers to work with these attributes
> or must we resort to raw html?
>
> For example, from the bootstrap doc:
>
> <button type="button" class="btn btn-primary" data-toggle="button">Single 
> toggle</button>
>
>
> Obviously TAG.BUTTON('Single toggle', _type='button', class='btn 
> btn-primary', data-toggle='button') will fail miserably because of the 
> "data-toggle" attribute.
>
>  --
> 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.
>

You can read an explanation for this topic at the end of chapter "HTML
Helpers" (http://web2py.com/books/default/chapter/29/5#HTML-helpers):

I think in your case you can use:

TAG.BUTTON('Single toggle', _type='button', class='btn btn-primary',
**{'_data-toggle': 'button'} )


or

TAG.BUTTON('Single toggle', _type='button', class='btn btn-primary',
data={'_data-toggle': 'button'} )


Santiago Avendaño
http://about.me/santiavenda2

-- 
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.

Reply via email to