On Tuesday, May 17, 2016 at 4:31:52 AM UTC-4, Vic Ding wrote: > > BTW, the following line is enough to trigger the remove function and > removal of the designated DIV, extra js to remove the div in the remove > function is not necessary. >
Correct -- the "delete" argument to the A() helper handles removal of DOM elements automatically. > A('delete', > callback=URL('product', 'removeProduct', args=str(row.id)), > delete='div#product' + str(row.id)) > > > The convention is to use substitution or the concatenation? %s or +? > You can use either, but in Python, I think string formatting syntax is more common. Concatenation is a little faster, but for more complex cases, string formatting tends to be more readable (you can also create a single string and pass it different data to generate different final outputs). 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.