There is a js code that trigger datatable, something like
"jQuery('.table_class').dataTable();". You want the script to be
executed AFTER the ajax content is retrieved. Web2py provides a
mechanism for this:

def data():
    rows=
db().select(db.statustable.ALL,orderby=db.statustable.createdon)
    response.headers['web2py-component-
command']="jQuery('.table_class').dataTable();" #<<<<
    return plugin_datatable(rows,_class='datatable', truncate=34)

The magic happens in #<<<. replace .table_class with the class of the
table.

On Feb 4, 6:01 am, Stefan <stefan.louis.no...@gmail.com> wrote:
> Hi all,
>
> (Sorry for the double-post in another thread: I thought that this
> should be its own post.)
>
> What's the trick to update a plugin_datatable display via an Ajax
> call?  As an example, I have the function:
>
> def data():
>     rows= db().select(db.statustable.ALL,
> orderby=db.statustable.createdon)
>     return plugin_datatable(rows,_class='datatable', truncate=34)
>
> However, when I make an Ajax call to return this, I get a standard/
> static SQLTABLE-esque form of the data.
>
> Your help is appreciated!
>
> Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to