Selected rows query

In the component, you have access to $this->selectedRowsQuery which is a Builder instance of the selected rows.

1public function exportSelected()
2{
3 if ($this->selectedRowsQuery->count() > 0) {
4 // Do something with the selected rows
5 }
6 
7 // Notify there is nothing to export
8}

See also Getting the selected keys if you would just like access to the selected primary keys.