are you using virtual fields? In powertable virtualfields properties is implemented with this @virtualsettings decorator, but only nedded if you are using virtual fields
Bruno Rocha http://rochacbruno.com.br mobile Em 18/12/2012 02:53, "FERNANDO VILLARROEL" <[email protected]> escreveu: > Dear. > > After looking some solution in google, i found this solution: > > > https://groups.google.com/forum/?fromgroups=#!topic/web2py-usuarios/gvxQAC3Xfts > > I added this lines to my controller: > > @auth.requires_login() > def pagos(): > > class Virtual(object): > @virtualsettings(label=T('Information:')) > def virtualtooltip(self): > return T('This is a virtual tooltip for record %s' > % self.pagos.id) > > Now powerTable works, anyone could me explain why? > > Regards. > > --- On *Mon, 12/17/12, FERNANDO VILLARROEL <[email protected]>* wrote: > > > From: FERNANDO VILLARROEL <[email protected]> > Subject: Re: [web2py] 'Row' object has no attribute powerTable > To: [email protected] > Date: Monday, December 17, 2012, 3:46 PM > > Dear. > > Why when i run: > > def test(): > return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id > ,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha) > > Works fine. > > But when i use powerTable occur the error: > > reg=db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id > ,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha) > powerTable = plugins.powerTable > powerTable.datasource = reg > powerTable.dtfeatures['sScrollY'] = '100%' > powerTable.dtfeatures['sScrollX'] = '100%' > powerTable.dtfeatures['bPaginate'] = True > powerTable.dtfeatures['bAutoWidth'] = True > powerTable._width='1020' > powerTable.dtfeatures['bSort'] = False #Se muestra ordenado por > Query > > > #powerTable.extra=dict(editable={'editablecallback':URL('llamadas','editablefunction')}) > powerTable.dtfeatures['iDisplayLength'] = 50 > powerTable.virtualfields = None > powerTable.headers='labels' > powerTable.showkeycolumn = False > powerTable.dtfeatures['bJQueryUI'] = > request.vars.get('jqueryui',True) > powerTable.uitheme = > 'redmond'#request.vars.get('theme','cupertino')#'smoothness' / 'redmond' > powerTable.dtfeatures['sPaginationType'] = > 'full_numbers'#request.vars.get('pager','full_numbers') # two_button > scrolling > powerTable.columns = ['pagos.id > ','pagos.fecha','pagos.monto','pagos.comments'] > #powerTable.extra = dict(autoresize={}) > powerTable.keycolumn = 'pagos.id' > powerTable.hiddecolumns=['pagos.id'] > table=powerTable.create() > return dict(table=table) > > > <type 'exceptions.AttributeError'> 'Row' object has no attribute 'pagos' > > Any idea what is wrong? > > > --- On *Mon, 12/17/12, FERNANDO VILLARROEL <[email protected]>* wrote: > > > From: FERNANDO VILLARROEL <[email protected]> > Subject: Re: [web2py] 'Row' object has no attribute powerTable > To: [email protected] > Date: Monday, December 17, 2012, 11:02 AM > > Dear Bruno. > > Yes works fine without powerTable > > The problem occur when i use powerTable. > > Regards > > --- On *Mon, 12/17/12, Bruno Rocha <[email protected]>* wrote: > > > From: Bruno Rocha <[email protected]> > Subject: Re: [web2py] 'Row' object has no attribute powerTable > To: [email protected] > Date: Monday, December 17, 2012, 1:04 AM > > what happens if you just return the Rows without using powerTable, it > works? > > def test(): > return db(db.pagos.id_clientes==session.cliente_id).select(db.pagos.id > ,db.pagos.fecha,db.pagos.monto,db.pagos.comments,orderby=~db.pagos.fecha) > > -- > > > > > -- > > > > > -- > > > > > -- > > > > --

