Re: [web2py] Table/grid with checkboxes for selecting records?

2012-05-11 Thread Bruno Rocha
A working example on plugin BadMin https://github.com/rochacbruno/badmin

On Fri, May 11, 2012 at 7:13 PM, Brian M bmere...@gmail.com wrote:

 How can I create a table/grid with a checkbox in front of each row so that
 multiple records can be selected for update/delete?  Something like your
 standard webmail inbox - check off a series of messages and then you can do
 something with them.  I've got a version working with SQLFORM.factory and a
 field that uses widget=SQLFORM.widgets.checkboxes.widget but it isn't
 anywhere near as polished of a look as I would like (my checkbox labels end
 up being rediculously long and really should be separate columns). Is there
 a nifty web2py way of doing this or do I just need to create the
 form/checkboxes myself in the view and leave behind the web2py form
 validation?

 Thanks,
 Brian




-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Table/grid with checkboxes for selecting records?

2012-05-11 Thread Brian M
Thanks Bruno!

So it looks like building the form myself in HTML is probably the way to go 
then. Would be nice to be able to have web2py do the form validation, but 
I'll survive.  I'm thinking that I might be able to mix and match - use 
form.custom to start the form and show some widgets for some other fields 
and then build the check boxes manually as long as I use the same field 
naming conventions.

On Friday, May 11, 2012 5:20:58 PM UTC-5, rochacbruno wrote:

 A working example on plugin BadMin https://github.com/rochacbruno/badmin

 On Fri, May 11, 2012 at 7:13 PM, Brian M  wrote:

 How can I create a table/grid with a checkbox in front of each row so 
 that multiple records can be selected for update/delete?  Something like 
 your standard webmail inbox - check off a series of messages and then you 
 can do something with them.  I've got a version working with 
 SQLFORM.factory and a field that uses 
 widget=SQLFORM.widgets.checkboxes.widget but it isn't anywhere near as 
 polished of a look as I would like (my checkbox labels end up being 
 rediculously long and really should be separate columns). Is there a nifty 
 web2py way of doing this or do I just need to create the form/checkboxes 
 myself in the view and leave behind the web2py form validation?

 Thanks,
 Brian




 -- 

 Bruno Rocha
 [http://rochacbruno.com.br]
  


Re: [web2py] Table/grid with checkboxes for selecting records?

2012-05-11 Thread Brian M
WhooHoo! Keeping the same SQLFORM in the controller and then just using 
form.custom (see 
http://web2py.com/books/default/chapter/29/7?search=form.custom) for my 
non-checkbox elements and then simply building the desired grid with check 
boxes myself in the HTML works beautifully. Just have to make sure that the 
input fields (check box elements) you create yourself use the same name as 
SQLFORM expects and form processing works as usual. (You loose the ability 
to preserve which items were selected if there is a form error, but for me 
that's minor and you could probably work around that if needed).

On Friday, May 11, 2012 7:53:51 PM UTC-5, Brian M wrote:

 Thanks Bruno!

 So it looks like building the form myself in HTML is probably the way to 
 go then. Would be nice to be able to have web2py do the form validation, 
 but I'll survive.  I'm thinking that I might be able to mix and match - use 
 form.custom to start the form and show some widgets for some other fields 
 and then build the check boxes manually as long as I use the same field 
 naming conventions.

 On Friday, May 11, 2012 5:20:58 PM UTC-5, rochacbruno wrote:

 A working example on plugin BadMin https://github.com/rochacbruno/badmin

 On Fri, May 11, 2012 at 7:13 PM, Brian M  wrote:

 How can I create a table/grid with a checkbox in front of each row so 
 that multiple records can be selected for update/delete?  Something like 
 your standard webmail inbox - check off a series of messages and then you 
 can do something with them.  I've got a version working with 
 SQLFORM.factory and a field that uses 
 widget=SQLFORM.widgets.checkboxes.widget but it isn't anywhere near as 
 polished of a look as I would like (my checkbox labels end up being 
 rediculously long and really should be separate columns). Is there a nifty 
 web2py way of doing this or do I just need to create the form/checkboxes 
 myself in the view and leave behind the web2py form validation?

 Thanks,
 Brian




 -- 

 Bruno Rocha
 [http://rochacbruno.com.br]