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)

        @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','products.category','
products.name','products.vendor','virtual.delete']
    tbl.virtualfields = Virtual()
    tbl.uitheme = 'redmond'
    tbl.datasource = 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