Basic usage of table - Table is created on the fly

Basic usage of table - Table is created on the fly

gliese581ggliese581g Posts: 1Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
I am using this plugin for the first time. I am developing an application using web2py framework of python. This application has a view(.html) file. I am creating a dynamic table in it by using python code blocks in between. I want this table to have sorting and paging capabilities. I have downloaded datatables plugin andplaced it in my application. The code which I have inclided in html file is given below:
[code]


Login




$(document).ready(function() {
$('#example').dataTable();
} );








ID
Method
Date
Status
Account
Name
Amount1
Amount2
Type



{{try:
for obj in result['output']:
}}

{{=obj['id']}}
{{=obj['method']}}
{{=obj['date']}}
{{=obj['status']}}
{{=obj['account']}}
{{=obj['name']}}
{{=obj['amount1']}}
{{=obj['amount2']}}
{{=obj['type']}}

{{else:}}

No Data Available

{{pass}}
{{except:
pass}}







[/code]
Paging and sorting is not working on the table. Please correct me if I am doing anything wrong over here.

*- Content written between curly braces (ex- {{pass}}) is Python code which web2py evaluates at run time.

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Please link to a test case as noted in the forum rules.

    Allan
This discussion has been closed.