Skip to content

soqlDatatable: Row Selection Events and Flow Outputs

James Hou edited this page Jan 24, 2021 · 1 revision

When this component's checkboxType is configured to Multi or Single, the base datatable emits a rowselection event which can be handled by any parent LWC:

// datatable.js
case 'rowselection': {
  this.dispatchEvent(
    new CustomEvent('rowselection', {
      detail: { selectedRows: this.selectedRows },
      bubbles: true,
      composed: true
    })
  );
  break;
}
<c-soql-datatable
  ...
  onrowselection={handleRowSelection}
  ...
></c-soql-datatable>
handleRowSelection(event) {
  console.log(event.detail.selectedRows);
}

This component also outputs selectedRows and firstSelectedRow to Flow screens as output variables.

See the soqlDatatable specification section for details.

Clone this wiki locally