0

In Magento 2.3.1, I want to do like :

If all store view, then input text should be enable. Othervise, input text should be disable.

I follow this answer : click here

But, still I'm not getting output.

How to do that?

Any help would be appreciated.

Thanks.

1

your form element should be like:

   <field name="sort_order" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">page</item>
            </item>
        </argument>
        <settings>
            <validation>
                <rule name="required-entry" xsi:type="boolean">true</rule>
            </validation>
            <dataType>text</dataType>
            <label translate="true">Sort Order</label>
            <dataScope>sort_order</dataScope>
             <imports>
                <link name="disabled">${ $.provider}:data.do_we_hide_it</link>
            </imports>
        </settings>
    </field>


   **And you Dataprovider condition should be like below:**



        if ($storeId && $storeId != 0) { 
        $this->loadedData[$banner->getBannerId()]['do_we_hide_it'] = true; 
        } else { 
        $this->loadedData[$banner->getBannerId()]['do_we_hide_it'] = false; 
        } 

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.