sabsto
You can use selectable, for example:
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()
On Fri, Mar 23, 2012 at 9:46 PM, Derek <[email protected]> wrote:
> Or you could avoid javascript, store the IDs of the "deleted" items in the
> session and do your own calls to the DAL to delete items.
>
>
> On Friday, March 23, 2012 7:33:42 AM UTC-7, Anthony wrote:
>>
>> Is it possible to select and delete multiple rows with one button click
>>> using SQLFORM.grid ? (instead of clicking delete on each row)
>>> I tried the "selectable" property but this doesn't help to delete.
>>> I searched the archive of this group / mailing-list without success
>>>
>>
>> Not out of the box. I suppose you could add a column (via the "links"
>> argument) with "delete" checkboxes, and then add a "delete checked" button
>> to the page with a Javascript event handler that identifies the checked
>> records, submits a request to the server, and then possibly reloads the
>> whole page or just the grid via Ajax.
>>
>> Anthony
>>
>