Hi,
I need to change the multi select attribute into checkbox so admin can easily checked attribute i am using magento 2.3
<item name="formElement" xsi:type="string">checkboxset</item>
<field name="cuisines"> <argument name="data" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Cuisines</item> <item name="options" xsi:type="object">Ricky\Hoteladvnce\Model\Config\Checkboxcuisines</item> <item name="config" xsi:type="array"> <item name="label" xsi:type="string" translate="true">cuisines</item> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">text</item> <item name="formElement" xsi:type="string">checkboxset</item> <item name="source" xsi:type="string">module</item> <item name="multiple" xsi:type="boolean">true</item> <item name="dataScope" xsi:type="string">cuisines</item> </item> </argument> </field>
public function toOptionArray() { return [['value' => "mx", 'label' => __('Mexican')], ['value' => "it", 'label' => __('Italian')], ['value' => "in", 'label' => __('Indian')] ]; }Outpurt
Thank for reply .... but my question about product page where the attribute (product attribute) with multi select option i need to convert that multi-select in checkbox so user can easily check more then one attribute without ctrl+click to select attribute ..
@piyush_khandelw if your have done this can you provide a solution here
<field name="size"> <argument name="data" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Cuisines</item> <item name="options" xsi:type="object">Vendor\Model_name\Model\Config\Checkboxzise</item> <item name="config" xsi:type="array"> <item name="label" xsi:type="string" translate="true">cuisines</item> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">text</item> <item name="formElement" xsi:type="string">checkboxset</item> <item name="source" xsi:type="string">module</item> <item name="multiple" xsi:type="boolean">true</item> <item name="dataScope" xsi:type="string">size</item> </item> </argument> </field>
Vendor\<Module_name>\Model\Config\Checkboxsize
In this class to return array which you want to show in checkbox option
for Example
return [['value' => "xs", 'label' => __('XS')], ['value' => "s", 'label' => __('S')], ['value' => "m", 'label' => __('M')] ];