0

I am using the https://webkul.com/blog/add-ui-select-with-search-filter-admin-form-magento2/ to create a search filter but what I was expecting was

enter image description here

I am getting is this, No search area.

enter image description here

1 Answer 1

0

Have a look at line 6:

<field name="customer" component="Webkul_Test/js/components/select-customer" sortOrder="20" formElement="select">
<argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="filterOptions" xsi:type="boolean">true</item>//to add filter in select-ui
        <item name="multiple" xsi:type="boolean">false</item>//select multiple or not
        <item name="showCheckbox" xsi:type="boolean">true</item> <!-- THIS LINE HERE -->
        <item name="disableLabel" xsi:type="boolean">true</item>
    </item>
</argument>
<settings>
    <required>true</required>
    <validation>
        <rule name="required-entry" xsi:type="boolean">true</rule>
    </validation>
    <elementTmpl>ui/grid/filters/elements/ui-select</elementTmpl>
    <label translate="true">Select Customer</label>//label to Field
    <dataScope>data.customer</dataScope>//To map
    <componentType>field</componentType>
    <listens>
        <link name="${ $.namespace }.${ $.namespace }:responseData">setParsed</link>
    </listens>
</settings>
<formElements>
    <select>
        <settings>
            <options class="Webkul\Test\Ui\Component\Create\Form\Customer\Options"/>
        </settings>
    </select>
</formElements>

Can you try putting "false" instead of "true"? I think that is the problem.

5
  • Did no effects.
    – Avesh Naik
    Jul 31, 2018 at 11:36
  • Have you ran the commands: php bin/magento setup:upgrade; php bin/magento cache:flush;
    – Raül
    Jul 31, 2018 at 11:40
  • setup upgrade ? yes
    – Avesh Naik
    Jul 31, 2018 at 11:40
  • I found the solution here. magento.stackexchange.com/questions/188528/… Thank you for help
    – Avesh Naik
    Jul 31, 2018 at 11:42
  • Can this be done with php code of addField? Because I cannot use ui_form for some reasons. please guide. Oct 16, 2020 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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