On 3 April 2012 11:45, Annet <[email protected]> wrote:
> At the moment I am using Alan Jardines Data Tables, it allows me to
> generate the following table:
>
> <div class="ez-box box_pad adm_alt_pagination">
> <table id="adm" class="display" style="font-size: 0.9em;">
> <thead>
> </thead>
> <tbody>
> {{for row in rows:}}
> <tr>
> <td>
> {{=row.organization}}
> </td>
> <td>
> {{=row.locality}}
> </td>
> <td>
> {{=A('Add_user', _class='button', _href=URL('adduser',args=[
> row.id]))}}
> </td>
> </tr>
> {{pass}}
> </tbody>
> </table>
> </div> <!-- ez_box -->
>
>
> I wonder whether I could build the same table using web2py's SQLFORM.grid.
>
>
> I would try:
links = [lambda row: A('Add usder' , _href = URL('default', 'adduserl',
args = [row.id]))]
fields = [db.organisation.organisation, db.organisation.locality]
data = SQLFORM.grid(db.organisation.id>0, fields = fields, links=links)
to start with.
You did not supply your model, so I am guessing.
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)