Skip to main content

Parameterized actions

For requiresParameters: true, return a config from getActionDialogConfig. DyonaGrid opens DyonaActionDialog and adds normalized form values to context.parameters. Actions with no matching config are disabled.

const changeStatusConfig: DyonaActionDialogConfig = {
schema: {
title: 'Change selected invoice status', hideSingleTab: true,
tabs: [{id: 'status', title: 'Status', rows: [{columns: [
{name: 'newStatus', label: 'New status', type: 'select', required: true, options: [
{label: 'Pending', value: 'pending'}, {label: 'Overdue', value: 'overdue'},
]},
{name: 'reason', label: 'Reason', type: 'textarea', required: true},
]}]}],
},
};

<DyonaGrid
{...gridProps}
actions={actions}
actionExecutor={actionExecutor}
getActionDialogConfig={(action) => action.id === 'change-status' ? changeStatusConfig : undefined}
/>

For a selection action, the dialog receives a snapshot of the IDs and available records at opening time. A successful selection action clears the Grid selection. In controlled mode this emits onSelectionChange([], []); a failed result or executor error keeps the selection.

Try Actions + Dialog in the Lab