[web2py] Re: smartgrid - display linked_tables link as a dropdown button instead

2015-07-06 Thread info
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 web2py+unsubscr...@googlegroups.com.
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']:



[web2py] Re: smartgrid - display linked_tables link as a dropdown button instead

2013-01-20 Thread Niphlod
i know that this can't be a full solution (and I haven't seen a screenshot 
of those grids) but at least having buttons on the left side should work 
better. did you try with button_placement = 'left' ?
also, for bootstrap customization, can't it be achieved using the ui dict ?

PS: if you can came up with a proof of concept (even a screenshot) it may 
help to code that into SQLFORM.grid directly.

On Thursday, January 17, 2013 10:14:59 PM UTC+1, 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?


-- 





[web2py] Re: smartgrid - display linked_tables link as a dropdown button instead

2013-01-20 Thread Simon Ashley
My original post hasn't turned up yet, so this may be a duplicate. There 
was an earlier request (last year) by Massimo, with code written by Martin 
Mulone to address the dropdown button issue. It may have slipped through 
the system and never implemented.

https://groups.google.com/forum/#!searchin/web2py-developers/buttons$20in$20grid/web2py-developers/naPIG3ORfrY/f34knZoozfcJ


-- 





[web2py] Re: smartgrid - display linked_tables link as a dropdown button instead

2013-01-19 Thread Simon Ashley
Its high on our list as well.  
That plus a denser edit/create/view layout similar to Scubism's Solid Form.

--