Thanks Bruno,

I needed a very simple table no extra layout so I did it with

table = TABLE()
for row in rows:
    table.append(TR(row.name, rows.sum, A(.....))

table.append(TR('Total', total))

Kenneth

I did it with powerTable plugin, see what I did.

<controller>
def deletable():
    class Virtual(object):
        @virtualsettings(label=T('Delete'))
        def delete(self):
return TAG.BUTTON(T('DELETE'),_class='deletebutton',_onclick='deleteRow(event,%s);' % self.products.id <http://self.products.id>)
        @virtualsettings(label=T('Counter'))
        def counter(self):
            return ''
    tbl = plugins.powerTable
tbl.dtfeatures['fnDrawCallback'] = """function ( oSettings ){for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ ){$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( 'Item ' + (i+1) );}}"""
    tbl.dtfeatures['fnRowCallback'] = ''
tbl.columns = ['virtual.counter','products.id <http://products.id>','products.category','products.name <http://products.name>','products.vendor','virtual.delete']
    tbl.virtualfields = Virtual()
    tbl.uitheme = 'redmond'
    tbl.datasource = db.products.id <http://db.products.id>>0
    return dict(table=tbl.create())
</controller>

Code: http://rochacbruno.pastebin.com/xE5kXKHF

Screenshot here: http://twitpic.com/3la1fl



--

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to