you don't waste any cpu on it, and your app won't break when grid code will eventually be changed to accomodate for new features and/or a much needed refactoring. Use the controller as a real controller and the view for the presentation/aestethic layer.
On Friday, October 2, 2015 at 2:22:53 PM UTC+2, Vinicius Assef wrote: > > Hi Niphlod. :-) > > Why would it be better at client side? > > -- > Vinicius Assef > > > > > On 2 October 2015 at 03:34, Niphlod <nip...@gmail.com <javascript:>> > wrote: > > for anyone's sake, do it client side............ > > > > > > On Friday, October 2, 2015 at 7:38:50 AM UTC+2, Alex Glaros wrote: > >> > >> Thanks Vinicius, > >> > >> it worked. > >> > >> if it couldn't find the value, it raised this error: > >> > >> <type 'exceptions.IndexError'> list index out of range > >> > >> > >> Is the below way acceptable way of preventing the error message? Or is > >> there a shorter way? > >> > >> try: > >> num_recs = int(grid.element('.web2py_counter')[0].split()[0]) > >> except Exception, e: > >> num_recs = 0 > >> else: > >> if num_recs > 1: > >> response.flash = T('The same zip code exists for more than > one > >> country. Choose one.') > >> > >> > >> thanks > >> > >> Alex > > > > -- > > 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+un...@googlegroups.com <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > -- 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.