so, with web2py 2.2.1 and powertable: db.acquisti.id_p.represent=lambda id: db.prodotti[id].nomeb #SQLFORM.grid: doesn't work; powertable: works db.acquisti.id_p.represent=lambda id, row: db.prodotti[id].nomeb #SQLFORM.grid: work; powertable: doesn't work
Massimo, aiutaci tu! ;) Il giorno sabato 24 novembre 2012 02:40:26 UTC+1, tomt ha scritto: > > I run into the same problem. I don't have a solution other than removing > the row from the represent statement when using powertable. > example: > db.acquisti.id_p.represent=lambda id: db.prodotti[id].nomeb > or > db.task.designer.represent = lambda value: db.staff[value].name > > The problem with this is that it will then generate an error if > SQLFORM.grid is used to display the same table. > > > On Friday, November 23, 2012 1:50:27 PM UTC-6, palomar wrote: >> >> Thanks for your tips but I have one more problem: >> in my model I use represent to view the title instead of the ID of a >> linked table: >> >> #db.acquisti.id_p.represent=lambda id, row: db.prodotti[id].nomeb >> >> that (I think) generate this error whit powertable: >> (<lambda>() takes exactly 2 arguments (1 given)) >> >> line 286: >> >> elif field.represent: >> r = field.represent(r) >> >> >> Someone can help me? >> ciao ;) >> >> Il giorno venerdì 23 novembre 2012 20:44:02 UTC+1, palomar ha scritto: >>> >>> i think >>> >>> response.files.append(URL(r=request,c='static',f='plugin_powertable/ui/css/%s/jquery-ui-1.8.24.custom.js')) >>> ;) >>> >>> Il giorno giovedì 18 ottobre 2012 06:06:33 UTC+2, tomt ha scritto: >>>> >>>> After a little digging around on the web I found out why I was >>>> powertable was generating errors with the latest web2py. >>>> >>>> jquery version 1.8 requires jquery-ui-1.8.22 >>>> >>>> I went to http://jqueryui.com/ and downloaded legacy v1.8.24 which >>>> provided jquery-ui-1.8.24.custom.zip. This zip file included >>>> jquery-ui-1.8.24.custom.min.js which I then copied to >>>> static/plugin_powertable/ui/js >>>> I modified models/powertable.py to load it: >>>> >>>> >>>> After taking these steps, the error messages are gone and now >>>> powertable works with no problems. >>>> >>>> >>>> >>>> On Sunday, October 14, 2012 9:10:17 PM UTC-6, tomt wrote: >>>>> >>>>> I noticed another problem with powertable and web2py 2.0.9 >>>>> >>>>> When I created a new app under web2py 2.0.9 and tried to implement a >>>>> powertable it exhibited some unusual behaviour. On initial callup, the >>>>> powertable showed all records instead of the number specified by >>>>> iDisplayLength and the columns don't show the column sorting icon. Also >>>>> the >>>>> column id is displayed even though table.showkeycolumn = False >>>>> >>>>> Firebug showed an error in plugin_powertable/jquery.dataTables.min.js: >>>>> "detailed error: TypeError: a.charCodeAt is not a function" >>>>> >>>>> I discovered that if I replaced /static/js/jquery.js with version >>>>> v1.7.1 from an earlier version of web2py, all the powertable problems >>>>> disappeared. >>>>> >>>>> Web2py 2.0.9 uses jQuery v@1.8.0 which apparently triggers the problem >>>>> with powertable. Earlier versions of web2py used jQuery v1.7.1 which >>>>> seems >>>>> to work ok with powertable. >>>>> >>>>> I'm wondering if I can make powertable work if I use a more recent >>>>> version of datatables? Which files from the datatables would I have to >>>>> incorporate? Any suggestions? >>>>> >>>>> - Tom >>>>> >>>>> >>>>> >>>>> >>>>> On Monday, October 8, 2012 5:42:46 PM UTC-6, rochacbruno wrote: >>>>>> >>>>>> Thanks, I will update the repo. >>>>> >>>>> --