Delete - Option Type D

How to Delete a row on Table Views

When adding the option type D to a table view, each row will have a delete option in the tool bars of the far right.

To add the delete tool, from the init Sections module add the option type D.

$PAGES_CONTENT->setOption([
    'name' => ['en'=>'PAGES', 'es'=>'VER PAGINAS', 'fr'=>'VOIR PAGES'],
    'privilege' => 5, 'type' => 'VD', 'main' => true
]);

Or use the manual value directly in the page

$options['delete']  = true; // Set false to disable.;

Use deleteOption to describe the native deletion confirmation. Validate related-record integrity in the owning server handler.

$deleteOption = [
   'column' => 'INVOICE_NO', // The value of a column that will be used in the prompt
   'prompt' => 'Invoice #' // The text that will be used in the prompt before the column value
];

In this example the prompt will say:

// "Are you sure that you want to delete Invoice # 12345?" (where INVOICE_NO = 12345)

If $deleteOption is not declared the prompt will use the ID name and value of the row:

// "Are you sure that you want to delete CLID 12345?" 

Related native actions

Section-level $actionButton, per-row $rowActions and selected-row bulk controls have different configuration and scope. Use Native Table View custom row actions for the complete manual-action array, placeholders, icons, tooltips, conditions, disabled states, confirmation, keyboard access and its relationship to Edit, Delete and Clone. Full arrays are the modern extensible format; strings remain compatible legacy shorthand. Each destination must authorize its request independently.