I'm working with Magento 2 and I need to configure an admin UI grid so that some rows cannot be selected via the checkbox column (i.e., they're unselectable in mass actions).
Is there a recommended way to make individual rows unselectable based on custom conditions or data in the row itself?
For example, I might want to flag some rows as non-actionable or protected, and prevent the user from selecting them via the mass action checkbox.
I'm using a custom UI grid defined via listing XML, with a block like this:
<selectionsColumn name="ids" sortOrder="10">
<settings>
<indexField>id</indexField>
<dataType>select</dataType>
</settings>
</selectionsColumn>
The grid uses a custom DataProvider that returns an array of items like this:
[
'totalRecords' => $totalRecords,
'items' => $pagedItems
];
Any guidance or best practices for achieving this in Magento 2 would be greatly appreciated!