Changes between Version 21 and Version 22 of ServerSidePagination


Ignore:
Timestamp:
01/20/10 04:35:02 (15 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ServerSidePagination

    v21 v22  
    3838sSearch
    3939}}}
     40response should be sent in tbhis format:
     41{{{
     42aaData": [
     43    [row1.field1.value, row1.field2.value, row1.field3.value],
     44    [row2.field1.value, row2.field2.value, row2.field3.value]
     45]
     46}}}
     47e.g. using a function like:
     48{{{
     49def callback():
     50    print request.vars
     51    from gluon.serializers import json
     52    query = ....
     53    rows = db(query).select() #<<<
     54    r=dict(rEcho=1,
     55           iTotalRecords=len(rows),
     56           iTotalDisplayRecords=len(rows),
     57           aaData=[[row.field1,row.field2] for row in rows])
     58    return json(r)
     59}}}
     60If you print request.vars you can easy figure out what paramers are being passed and change the <<< line accordingly.
    4061=== JSON Back-end implementation ===
    4162 * Support already present in {{{modules\s3xrc.py}}}