Richard, you know what? maybe it does what you want actually because what I get is a bunch of records with a txt and one submit button at the end. So, basically a grid within a form. I will write it and run it again and send you a screenshot.
D On Friday, 13 April 2012 12:36:29 UTC-7, Richard wrote: > > Yes I think I miss understood... What I would have is the capability to > insert many records in one operation (one form submission). I thought that > what Massimo suggest turn the SQLFORM.grid in a kind of multiples rows form > or something like that. It was not actually clear what Massimo was doing > what Massimo suggested. That why I ask you if you were willing to show a > screenshot of the result. > > Don't mind if I actually miss understand. > > Cheer. > > Richard > > On Fri, Apr 13, 2012 at 3:26 PM, greenpoise <danel.sega...@gmail.com>wrote: > >> Richard, >> >> I tried Massimos approach but it created one form button rather than one >> for each row. For my uses, it wont cut it. I need one text field plus a >> button on each row. I was able to accomplish this like this >> >> links = [lambda row: INPUT(_name='qty', _value='1'), lambda row: A('+', >> callback=URL('cart_callback',vars=dict(id=row.id,action='add',qt=request. >> vars.qty)))] >> >> Maybe I did not make myself clear but I just want to have a product grid >> with all the products and the qty. Sort of a storefront, so the input text >> is not db attached. Click on the button and add it to my cart.. Hmmm but it >> seems you want to have like a bulk functionality with the grid, right??? >> >> >> >> >> >> >> >> On Thursday, 12 April 2012 14:27:53 UTC-7, Richard wrote: >>> >>> Hello Danel, >>> >>> May I see screenshot of what Massimo propose? >>> >>> I mean I would be really interrested in a bulk entry capability too. >>> >>> If it is already available I would know I was about to make a custom >>> mechanism to allow user to add many result at the same time that would rely >>> on Excel and validate_and_insert web2py method... >>> >>> The problem I had was to read directly Excel file, I would need to write >>> a lot of code with xlrd. If I can avoid that I will be happy :) >>> >>> Thanks. >>> >>> Richard >>> >>> On Thu, Apr 12, 2012 at 5:14 PM, greenpoise <danel.sega...@gmail.com>wrote: >>> >>>> Massimo, >>>> >>>> where do I change the INPUT size (length, width)? >>>> >>>> >>>> >>>> links = [lambda row: INPUT(_name='quantity', _class='integer', >>>> _value=1)] >>>> >>>> >>>> >>>> >>>> >>>> On Wednesday, 11 April 2012 18:34:16 UTC-7, Massimo Di Pierro wrote: >>>>> >>>>> yes and not and what I said needs clarification. >>>>> >>>>> grid = SQLFORM.grid(create=False,update=False) is not a form. If >>>>> create=True or update=True then it contains a form when you are creating >>>>> or >>>>> updating a record. you must avoind a form within a form and you can do so >>>>> in the view: >>>>> >>>>> {{if grid.create_form or grid.update_form:}} >>>>> {{=grid}} it is a form >>>>> {{else:}} >>>>> <form>{{=grid}} it is not a form but you can embed it in one >>>>> <input type='submit'/></form> >>>>> {{pass}} >>>>> >>>>> >>>>> On Wednesday, 11 April 2012 20:23:08 UTC-5, greenpoise wrote: >>>>>> >>>>>> A bit confused..I thought SQLFORM.grid was itself a form? Also, can I >>>>>> add more than one link per grid? Reading from the book, it creates a >>>>>> column >>>>>> so technically sounds as if I could??? >>>>>> >>>>>> On Wednesday, 11 April 2012 16:27:17 UTC-7, Massimo Di Pierro wrote: >>>>>>> >>>>>>> You can put the grid in a form and you add >>>>>>> >>>>>>> SQLFORM.grid(..., link=[lambda row: INTPUT(...)]) >>>>>>> >>>>>>> On Wednesday, 11 April 2012 17:07:58 UTC-5, greenpoise wrote: >>>>>>>> >>>>>>>> Is this possible?? I have a products table that shows all the >>>>>>>> products. I also created an add to cart button in it problem is if I >>>>>>>> want >>>>>>>> to add 100 items I would have to press the button 100 times. Is there >>>>>>>> a >>>>>>>> way to add a quantity text field??? >>>>>>>> >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> Dan >>>>>>>> >>>>>>> >>>>>> On Wednesday, 11 April 2012 16:27:17 UTC-7, Massimo Di Pierro wrote: >>>>>>> >>>>>>> You can put the grid in a form and you add >>>>>>> >>>>>>> SQLFORM.grid(..., link=[lambda row: INTPUT(...)]) >>>>>>> >>>>>>> On Wednesday, 11 April 2012 17:07:58 UTC-5, greenpoise wrote: >>>>>>>> >>>>>>>> Is this possible?? I have a products table that shows all the >>>>>>>> products. I also created an add to cart button in it problem is if I >>>>>>>> want >>>>>>>> to add 100 items I would have to press the button 100 times. Is there >>>>>>>> a >>>>>>>> way to add a quantity text field??? >>>>>>>> >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> Dan >>>>>>>> >>>>>>> >>> >