What about if I don't use 'callback' but 'href' so it loads the whole page. I still can't get the quantity value to be passed as an arg.
On Saturday, 26 November 2016 14:35:33 UTC+1, Anthony wrote: > > On Friday, November 25, 2016 at 11:11:41 PM UTC-5, Paul Ellis wrote: >> >> Hi, >> I am trying to do the same thing as the OP. Add a quantity input field to >> a grid and then use Callback to work with the product_id and quantity. I >> just don't seem to be able to pass the quantity to the callback function. >> >> Using this method I don't get a value from quantity. >> links=[ >> lambda row: INPUT(_type='number', _value=0, >> _name='qty'), >> lambda row: A(T('Add'), >> >> callback=URL('_add_product',args=[row.id, request.vars.qty]), >> > > Obviously request.vars.qty won't work here, as request.vars is not > populated until after the request arrives at the server. Instead, you would > have to use Javascript to update the callback URL whenever the value of the > input changes. > > Anthony > -- 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.