Skip to content

How to set the default value of a selection column to be checked or unchecked

I have a data grid used as part of a form in the admin area for a custom entity. I have this data populating as I need, with one exception. I need the check-boxes to be checked by default for certain rows if the data already exists from the dataprovider. I’d hoped that it would be possible to render this value based on the returned value of the exists key from the dataprovider, but this seems not to be the case.

Is there anyway to dynamically set the value of this column?

  <selectionsColumn name="exists">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="indexField" xsi:type="string">id</item>
            </item>
        </argument>
    </selectionsColumn>