delete record in grid

is there any way I can delete a record in the grid by ticking the record and clicking on a delete button?

how can I achieve that without having to open the record and then delete it?

You can use a editable grid / editable grid view. In the normal grid the records are readonly and can’t (not simple) delete.

[LIST=1]

  • You can create a Run button, collect the id of the records, redirect to a control application with the IDs as param, and perform a delete there. Then redirects back.
  • You can create a virtual field, with a red cross image, thath links to a control application, passing ID as param, and perform a delete there. Then redirects back.
  • You can do both. 1 and 2 [/LIST] Of course, you can use a form in "editable grid" mode too as RHS suggest
  • I usually use a simplified version of method 1. described by Giu, doing everything inside the PHP run button:

    • onRecord, directly execute a SQL delete of each single record
    • onFinish, just show a feedback message to the user

    I guess it’s not very efficient compute wise, especially if you process many records and the sql server is remote to the http server, but it’s very simple in terms of code and no need to redir to any external app.

    Can I include security to those buttons? so I can restrict the button to appear only to administrators? I don’t want everyone to be able to delete records

    thanks

    You have to control manually

    EDIT: Or control wich groups has access to “visit” the application createrd to delete the records.