addQuickItems & deleteSelected
Two actions designed specifically for data-table controls. addQuickItems inserts one or more preset rows with a single click. deleteSelected removes all checked rows. Together they power efficient data-grid workflows.
addQuickItems
The addQuickItems action appends preset row objects to a data-table control's value array. This is ideal for recurring line items — a set of standard invoice lines, a standard set of permissions, a template set of reminders.
Schema Example — Reminders
{
"type": "addQuickItems",
"label": "Add Standard Reminders",
"variant": "secondary",
"icon": "bell",
"config": {
"targetControlId": "reminders-table",
"items": [
{ "type": "email", "daysBefore": 7, "message": "One week reminder" },
{ "type": "email", "daysBefore": 1, "message": "One day reminder" },
{ "type": "sms", "daysBefore": 0, "message": "Day-of reminder" }
]
}
}
Multiple Quick-Add Buttons
You can have multiple addQuickItems actions for the same table, each inserting a different preset:
// Two different preset sets for the same table
{
"type": "addQuickItems",
"label": "Add Basic Plan Lines",
"config": {
"targetControlId": "invoice-lines",
"items": [
{ "description": "Setup fee", "qty": 1, "price": 500 },
{ "description": "Monthly licence", "qty": 12, "price": 99 }
]
}
},
{
"type": "addQuickItems",
"label": "Add Enterprise Plan Lines",
"config": {
"targetControlId": "invoice-lines",
"items": [
{ "description": "Enterprise licence", "qty": 1, "price": 2400 },
{ "description": "Dedicated support", "qty": 12, "price": 500 }
]
}
}
deleteSelected
The deleteSelected action removes all rows whose checkbox is checked in the target data-table. The button is automatically disabled when no rows are selected.
Schema Example
{
"type": "deleteSelected",
"label": "Remove Selected",
"variant": "danger",
"icon": "trash",
"config": {
"targetControlId": "reminders-table",
"showConfirmDialog": true,
"confirmMessage": "Delete the selected reminders?"
}
}
Required data-table Configuration
The target data-table must have deletable: true and selectable: true in its settings for delete to work, and addable: true to accept new rows:
{
"id": "reminders-table",
"type": "data-table",
"settings": {
"addable": true,
"deletable": true,
"selectable": true,
"columns": [
{ "field": "type", "label": "Type" },
{ "field": "daysBefore", "label": "Days Before" },
{ "field": "message", "label": "Message" }
]
}
}