Hello,
I have 7 actions per row so it would be great to have actions dropdown.
Please find attached patch for bootstrap theme.
for Version 2.11.2-stable+timestamp.2015.05.30.16.33.24
On Thursday, January 17, 2013 at 11:14:59 PM UTC+2, Jim S wrote:
>
> I have a number of smartgrids built where the number of linked tables is
> pushing the other edit/delete buttons off the right of the page. I'm
> wondering if there is a simple way that I've missed where you can put your
> linked_table links into a dropdown button of different 'actions' you could
> perform on the row. Seems like this should be easy with the fancy twitter
> bootstrap buttons available. Also, can I override the default buttons
> (display/edit/delete) with some twitter bootstrap buttons?
>
> Should this be an enhancement request?
>
--
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.
--- a/gluon/sqlhtml.py
+++ b/gluon/sqlhtml.py
@@ -1967,7 +1967,8 @@ class SQLFORM(FORM):
cache_count=None,
client_side_delete=False,
ignore_common_filters=None,
- auto_pagination=True):
+ auto_pagination=True,
+ dropdownactions=False):
formstyle = formstyle or current.response.formstyle
@@ -2755,6 +2756,21 @@ class SQLFORM(FORM):
callback=url(args=['delete', tablename, id]),
noconfirm=noconfirm,
delete='tr'))
+
+ if dropdownactions:
+ from gluon import BUTTON
+ row_buttons = DIV(
+ BUTTON(T('Action'), SPAN(_class="caret"),
+ _class="btn dropdown-toggle",
+ _href="#",
+ **{'_data-toggle': 'dropdown',
+ '_aria-expanded': 'true'}
+ ),
+ UL([LI(_btn) for _btn in row_buttons],
+ _class="dropdown-menu"),
+ _class='dropdown'
+ )
+
if buttons_placement in ['right', 'both']:
trcols.append(row_buttons)
if buttons_placement in ['left', 'both']: