2

i m trying to create form using ui-component. i want to create element SELECT like Product attribute set.

enter image description here

This field is created in my module but the searching is not displaying like below

enter image description here

uiComponent Form Element Field

<field name="product_id">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Magento\Catalog\Model\Product\AttributeSet\Options</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Poduct</item>
                    <item name="componentType" xsi:type="string">field</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                    <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    <item name="dataScope" xsi:type="string">product_id</item>
                    <item name="filterOptions" xsi:type="boolean">false</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="chipsEnabled" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">20</item>
                    <item name="listens" xsi:type="array">
                        <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                    </item>
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">conditions</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>

Did I forgot to add Some js liabrary In ?

2

Just change this option from

<item name="filterOptions" xsi:type="boolean">false</item>

to

<item name="filterOptions" xsi:type="boolean">true</item>
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.