2

I have created Inline editing in list using UI Component. The Inline editing works fine.

Now I want to disable certain field from being updated.

How can i implement this in magento 2?

1

Try Below code:-

Disable Inline Edit

<column name="field_name" sortOrder="30">
            <settings>
                <filter>text</filter>
                <label translate="true">field_name</label>
            </settings>
</column>

If You Want To Apply Inline Edit:-

<column name="field_name" sortOrder="40">
            <settings>
                <filter>text</filter>
                <editor>
                    <editorType>text</editorType>
                </editor>
                <label translate="true">field_name</label>
            </settings>
 </column>

Hope this will work for you.

0

In You Listing File Add Simply This Code For Disable Inline Edit :-

<column name="field_name" sortOrder="70">
    <settings>
        <label translate="true">Field Lable</label>
    </settings>
</column>

If You Want To Apply Inline Edit :-

<column name="field_name">
      <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
              <item name="editor" xsi:type="array">
                 <item name="editorType" xsi:type="string">text</item>
              </item>
           </item>
      </argument>
 </column>

Hope this will work for you.

0

Just Remove the Editor nodes.like <item name="editor" xsi:type="array"> <item name="editorType" xsi:type="string">text</item> </item> from the which columnn you dont need inline edit.

0

Remove this tag from that column where you want to disable editor.

<editor>
          <editorType>date</editorType>
    </editor>
0

To disable inline edit,go to ui_component xml file under magento root directory which looks like:

app/code/Vendor/ModuleName/view/adminhtml/ui_component/my_file.xml

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
   <columns name="mycolumn">
        <settings>
            <editorConfig>
                <param name="enabled" xsi:type="boolean">false</param>
            </editorConfig>
        </settings>
    </columns>
</listing>

As shown above find your column and add settings there.

Hope it helps!

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.