use components, luke!

Il giorno giovedì 10 ottobre 2013 17:07:04 UTC+2, Gael Princivalle ha 
scritto:
>
> Hello.
>
> I've a page with a lateral accordion menu, and a sqlform.grid.
> Can I update the sqlform.grid query clicking on one of my lateral menu 
> item ?
>
> Of course Id' like to make it without a page reload.
>
> Thanks.
>
> My db:
>     db.define_table('models',
>         Field('code', unique=True),
>         Field('category'),
>         Field('description_en'),
>         Field('description_it'),
>         Field('pdf_path'))
>
> My controller:
> def hydrover_products():
>     db.models.pdf_path.readable = False
>     fields = 
> (db.models.code,db.models.category,db.models.description_it,db.models.pdf_path)
>     headers = {'models.code':   T('Product model'),
>            'models.category': T('Category'),
>            'models.description_it': T('Description'),
>            'models.pdf_path': 'pdf_path' }
>     links = [dict(header=T('Catalogue'), body=lambda row: A('Download', 
> _href=row.pdf_path, _target='_blank'))]
>     maxtextlengths={'models.code': 6, 'models.description_it': 120}
>     grid = SQLFORM.grid(db.models, headers=headers, fields=fields, 
> csv=False, maxtextlengths=maxtextlengths, orderby=db.models.code, 
> links=links,links_in_grid=True)
>     return dict(grid=grid)
>
>

-- 
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/groups/opt_out.

Reply via email to