I'm not sure if this will help, but you can display an array of rows
and not the whole table. Example:
def task_powerlist_bycpa():
id=request.args(0)
tasks=db(db.task.cparef==id).select(db.task.ALL)
table = plugins.powerTable
table.datasource = tasks
table.keycolumn = 'task.id'
table.showkeycolumn = False
table.columns = ['task.title', 'task.ls_js', 'task.sc_js']
table.headers = 'labels'
table.extra = dict(autoresize={})
return dict(table=table.create())
In this case, I display a subset of the task table based on a query.
On Feb 18, 4:27 pm, Ialejandro <[email protected]> wrote:
> Hi everybody!! I have a new doubt, this time I'm trying to customize a
> table generated by a search, this is what I have:
>
> (Model)
>
> db.define_table('category',
> Field('name','string'),format='%(name)s')
>
> db.define_table('book',
> Field('name','string),
> Field('code','string),
> Field('category_id',db.category,requires= IS_IN_DB(db,
> db.category.id,'%(name)s'))
>
> def index():
>
> form=SQLFORM(db.books,fields=['category'])
>
> if FORM.accepts(form,request.vars,keepvalues=True):
>
> books=db(db.book.category==request.vars.project).select(db.category.ALL)
> else:
> books=None
> return dict(form=form,books=books)
>
> So at the /default/index, I show up a dropdown with all the
> categories, so when a user selects one and press submit it will show a
> table with the results. What I need is use that result data to
> populate thepowerTableplugin considering that a user can search with
> many times, and every time the power table, must be refreshed and
> filled with the new result. How can I do that? Is there any easiest
> way?
>
> Thanks!!