Thank you all for replying.
So what I wanted was a "select all" checkbox on top of the grid, after
doing some searching, I hacked this together myself.
after defining the grid I put in the following code:
heading=grid.elements('th')
if heading:
heading[0].append(INPUT(_type='checkbox', _onclick="checkboxes =
document.getElementsByName('records');for each(var checkbox in
checkboxes)checkbox.checked = this.checked;"))
I have no knowledge in javascript or html so I am not sure how robust the
solution is, but it seems to work fine for me.
On Monday, March 11, 2013 5:01:50 PM UTC-7, Jack wrote:
>
> Hi all,
>
> I was playing around with selectables in the grid and smartgrid and found
> this example code in the mailing list:
>
> selectable = lambda ids: delete(ids)
> form=SQLFORM.grid(query,
> selectable=selectable)
>
> def delete(ids):
> to_delete=db(db.tabla.id.belongs(ids))
> to_delete.delete()
>
>
> It enables a checkbox in front of each row and a button to delete the
> selected rows. This is working as expected but I was wondering is there a
> way to enable a select all checkbox?
> I did some search but couldn't find anything. Is there something I'm
> missing?
>
> Thanks
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.