[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2017-06-23 Thread Anthony
On Friday, June 23, 2017 at 4:01:05 AM UTC-4, kesh wrote: > > hi guys sorry to intrude, i have a problem here >> > db.define_table('stock_status', > Field('Date', 'datetime', default=request.now, writable=False), > Field('SN'), > Field('item_description'), > Field('Quantity','intege

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2017-06-23 Thread kesh
> > hi guys sorry to intrude, i have a problem here > db.define_table('stock_status', Field('Date', 'datetime', default=request.now, writable=False), Field('SN'), Field('item_description'), Field('Quantity','integer'), Field('UOM'), Field('stockIN','integer'), Field('st

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2015-08-21 Thread Raphael Lechner
Hi, I have the same issue. I added a checkbox to the form, but I can't get the value after submitting. if request.args(0) == 'new': my_extra_element = DIV(LABEL('Create Remote SSH Key',_class="control-label col-sm-3"),INPUT(_name='create_key',_type='checkbox'), _class="form-group")

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2014-02-28 Thread Maciej S
Hi! I've created SQLFORM.grid like whowhywhat did. New elements have been added to the form, but there is one drawback, if I submit, all data from new fields is lost. What should I do to keep it during callbacks? Here is my code: def users(): grid = SQLFORM.grid(db.auth_user) i

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread Cliff
Nice. It seems I recall that form.process() does not handle inserted fields. Just something to look out for when you get to the next stage. On Dec 16, 11:03 am, whowhywhat wrote: > wow .. it works! :) ... > > i just added the following in the controller (after calling SQLFORM.grid): > > #check

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
wow .. it works! :) ... i just added the following in the controller (after calling SQLFORM.grid): #check if form is a create form if len(request.args)>1 and request.args[-2]=='new' and form.create_form: my_extra_element = TR(LABEL('Married'),INPUT(_name='married',value=False,_type='checkbo

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread Anthony
> > is there a simpler way to just insert some extra elements like > http://web2py.com/book/default/chapter/07#Adding-extra-form-elements-to-SQLFORM > . > I tried this, but this throws up an error (I will check and get back) > That's the way to do it. You can also use the .element() and .elem

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
:) .. that sounds right.. i guess i can just add some jquery in the view with a condition to check if the view is for edit or create form. The jquery could just insert the checkbox (if married etc.).. if checked i could use jquery to un-hide the spouse name field row. I will also try out the cu

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread Anthony
On Friday, December 16, 2011 9:39:46 AM UTC-5, whowhywhat wrote: > > i am trying to figure out the SQLFORM.grid from the source. The create and > update forms are generated using SQLFORM and not crud.. my mistake thinking > this was done by CRUD. I guess i will need to customize the form by passi

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
i am trying to figure out the SQLFORM.grid from the source. The create and update forms are generated using SQLFORM and not crud.. my mistake thinking this was done by CRUD. I guess i will need to customize the form by passing form.create_form.append(whatever) .. is this the right way? .. i will

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
Thanks a lot for the prompt reply Cliff. The tip you gave me is something i did not know about and will be handy.. However this is useful to modify the grid in itself. I need some way to modify the subsequent Create, Edit and Update pages (if grid is editable). That is if i click on the add butt

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread Cliff
The grid acts like a DIV(). So if form=SQLFORM.grid Then form[0] is the shaded area with the search bar. Likewise form[1] is the table with the data in it. You could do form[1].append(whatever) or form[1].insert(-1, stuff). form.process().accepted becomes form[1].process().accepted If I recall