Fast Edit
fastedit is a per-row table button that turns an existing row into editable inputs inline,
so a single record can be updated without opening a separate edit page.
Like every fast element, it is used with a table. You enable it per row through
$table['tb_list_button'], and fastedit_action tells the framework which table/handler the row
belongs to so the change can be saved.
Use fastedit when:
- A row in an inline table needs to be edited in place.
- The detail records belong to a parent record shown on the same page.
- You want inline edit + delete on each row of a managed table.
Enable fastedit per row
Real example from customer/related_parties.module.php — each related-party row gets a fastedit
and a fastdelete button via tb_list_button. The *_action keys name the target table/handler.
- Row buttons
- PHP (module)
{
"row_id": 25,
"fastedit": true,
"fastedit_action": "related_parties",
"fastdelete": true,
"fastdelete_action": "interrelation"
}
$table['tb_id'] = 'related_parties';
$table['tb_get'] = 'add_related_parties_row';
$table['tb_button'] = ['fastadd' => true, 'fastdelete' => true];
$table['tb_header'] = [ /* ... columns ... */ ];
foreach ($related_parties as $party) {
$table['tb_body'][] = [ /* ... row cells ... */ ];
// Per-row fast buttons
$buttons = ['row_id' => $party['id']];
$buttons['fastedit'] = true;
$buttons['fastedit_action'] = 'related_parties';
$buttons['fastdelete'] = true;
$buttons['fastdelete_action'] = 'interrelation';
$table['tb_list_button'][] = $buttons;
}
$buf .= $this->addons->magic->get_table($table);
Behavior
- Bound to a table:
fasteditlives in$table['tb_list_button'], one entry per row. - Row identity:
row_ididentifies which record the button acts on. - Action target:
fastedit_actionnames the table/AJAX action used to load and save the edited row. - Inline edit: Clicking switches the row to editable inputs; saving persists the change for that row.
Usage Notes
- Set
row_idon everytb_list_buttonentry so the framework knows which record to edit. - Pair
fasteditwithfastedit_action; without the action the row cannot be saved. - To edit all rows of a table at once (not just one), use Full Fast Edit.