Complementing the line: db.produto.virtualfields.append(VirtualFields())
causes error in creating the tables below it. On Oct 21, 9:00 am, Savio Sabino <[email protected]> wrote: > Hello. > I did the following test with virtual fields: > > db.define_table('product', > Field ('type', db.tp_produto) > Field ('manufacturer', db.fabricante) > Field ('qt', 'integer', default = 0), > Field ('qt_min', 'integer', default = 0) > ) > db.product.type.requires IS_IN_DB = (db, db.tp_product.id, '% (name) > s') > db.product.manufacturer.requires IS_IN_DB = (db, db.manufacturer.id, > '% (name) s') > > VirtualFields class: > def input(self): return 2 * self.product.qt_min > db.product.virtualfields.append(VirtualFields()) > > The version of web2py in use is 1.87.3 > > The new virtual field appears neither in the appadmin. What's missing? > > On Oct 20, 11:40 am, mdipierro <[email protected]> wrote: > > > I never tried but you can try define virtualfields: > > >http://www.web2py.com/book/default/chapter/06?search=virtualfield > > > and they should appear in jqgrid > > > On Oct 20, 9:35 am, Savio Sabino <[email protected]> wrote: > > > > Thanks this is nice solution. And very thanks for the great > > > framework. > > > > And now... How do I add the two fields (deposit and withdraw) that no > > > store data and be used only in the view? > > > Must create a virtual copy of this table for and add fields? How? > > > > Take this opportunity to mention that I am newbie to web2py (I think > > > it already has to see it) and running of java and .net. > > > > On Oct 20, 11:18 am, mdipierro <[email protected]> wrote: > > > > > In model: > > > > > db.table.field.represent=lambda value:A('click me',_href=value)) > > > > > and this will be used by jqgrid > > > > > On Oct 20, 6:41 am, Savio Sabino <[email protected]> wrote: > > > > > > Hello again. > > > > > I have a new question. > > > > > The current way of using jqgrid is with plugin_wiki? Even in the view > > > > > or controller? > > > > > > How would I do to implement a grid like this: > > > > > > Table user > > > > > > id, name, email, money, deposit, withdraw > > > > > > The id field must have a link for editing the user. > > > > > Add and drop fields should launch a modal popup with fields of type > > > > > "value, reason, date, etc". > > > > > > My question is how to create columns that have links (<a href="">) and > > > > > events (onclick) in jqgrid within the controller or view on style > > > > > web2py? And if it is not asking much, with some fields (deposit and > > > > > withdraw) containing images? > > > > > > Should choose to make a simple table or other component for that? > >

