I think you will need something like this:
<table id="sortpage">
<thead>
<tr>
<th>Title</th>
etc...
</tr>
</thead>
<tbody>
{{for r in results:}}
<tr>
<td>{{=r.title}}</td>
etc...
</tr>
{{pass}}
</tbody>
</table>
<div id="pager"></div>
Then at the end of web2py_ajax_init javascript function of
web2py_ajax.html:
jQuery("#sortpage").dataTable();
Hope that helps.
On Aug 26, 12:27 pm, FERNANDO VILLARROEL <[email protected]>
wrote:
> Dear All.
>
> I am trying of doing a query for get some records from a database and show
> results on a Data Tables (Jquery), i am new in Web development (Ajax and
> Jquery, Json, etc.) and i want know how doing.
>
> The idea is get all records that fecha >= to var "desde" and show in a Data
> Tables
>
> Controller:
>
> def llamados():
>
> import time
>
> hoy=time.time()
> desde=time.strftime('%Y-%m-%d 00:00:00',time.localtime(hoy))
>
> form=FORM(TABLE(TR("Desde ( Año-mes-día
> ):",INPUT(_type="datetime",_name="desde",_value=desde,_class='datetime',_id="datetlimite",
> requires=IS_DATETIME())),
> TR("",INPUT(_type="submit",_value="Consultar"))))
>
> if form.accepts(request.vars,session):
>
>
> rows=db.db(db.llamados.id_clientes==session.cliente_id).select(db.llamados.fecha>=form.vars.desde)
>
> return dict(form=form,rows=rows,vars=form.vars)
>
> Views:
>
> View: llamados.html
>
> {{extend 'layout.html'}}
>
> <h2>Registro de Llamados</h2>
>
> {{=form}}
>
> .......here Data Tables!!!!!
>
> How i can show the Datatables below to the form or if need show the Data
> Tables on another views?.
>
> Anyone could me explain how i can doing.
>
> Fernando.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---