Skip to main content

Fast Delete

fastdelete is a table button for removing a row inline. It appears as a delete icon (<a class="ei-delete save fastdelete">) on a row, and removes the record without a separate page.

Fast elements are always used with a table. fastdelete can be enabled both at table level ($table['tb_button']) and per row ($table['tb_list_button']). The fastdelete_action key names the table/handler the row should be deleted from.

Use fastdelete when:

  • A row in an inline detail table needs to be removed.
  • You want a one-click delete directly from the list of child records.
  • You need delete to work together with fastadd / fastedit on the same table.

Enable fastdelete

Real examples: installment/company_branch.module.php enables it at table level and renders the delete icon in the AJAX row; per-row deletes are configured through tb_list_button with a fastdelete_action.

{
"fastdelete": true,
"fastdelete_action": "company_branch_product",
"row_id": 5
}

Fast Delete


Behavior

  • Bound to a table: fastdelete works inside a table built with magic->get_table().
  • Two levels: Enable it on the whole table with $table['tb_button'], and/or per row through $table['tb_list_button'].
  • Action target: fastdelete_action names the table/handler the row is deleted from.
  • Row identity: row_id (existing rows) or the data-id on the icon (newly added rows) identifies which row to remove.

Usage Notes

  • Newly added fastadd rows carry a temporary data-id (tb_xxxxx) and are removed from the DOM; existing rows use their real row_id and are deleted from the database via fastdelete_action.
  • Provide fastdelete_action whenever the row maps to a real database record.
  • Combine with Fast Add and Fast Edit for full inline row management.