I'm building a feature where I need to render checkboxes for a set of comma-separated values in a column.
Here's my existing code:
protected function fillModifierMeta()
{
return [
'id' => $this->getTextColumn('id', false, 'Product ID', 10),
'product_sku' => $this->getTextColumn('product_sku', false, 'Product SKU', 20),
'product_name' => $this->getTextColumn('product_name', false, 'Product Name', 30),
'product_supplier_sku' => $this->getTextColumn('product_supplier_sku', false, 'Supplier SKU', 40),
'available_qty' => $this->getTextColumn('available_qty', false, 'Available Qty', 50),
'received_qty' => [
'arguments' => [
'data' => [
'config' => [
'dataType' => Form\Element\DataType\Number::NAME,
'formElement' => Form\Element\Input::NAME,
'componentType' => Form\Field::NAME,
'dataScope' => 'received_qty',
'label' => __('Receive Qty'),
'fit' => true,
'additionalClasses' => 'admin__field-small',
'sortOrder' => 60,
'validation' => [
'validate-number' => true,
'validate-greater-than-zero' => true,
'required-entry' => true,
],
],
],
],
],
'actionDelete' => [
'arguments' => [
'data' => [
'config' => [
'additionalClasses' => 'data-grid-actions-cell',
'componentType' => 'actionDelete',
'dataType' => Form\Element\DataType\Text::NAME,
'label' => __('Actions'),
'sortOrder' => 70,
'fit' => true,
],
],
],
]
];
}
Now, I want to add a field to this called barcodes
which contains value such as EG6F2,A4GT5,EF58T,Y1W3R
. I want to render these as selectable checkboxes in the column.
Is there a way to achieve this?