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?

Avesh Naik
  • 1,200
  • 11
  • 39

5 Answers5

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.

Devidas
  • 3,358
  • 1
  • 27
  • 61
1

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!

temper
  • 994
  • 11
  • 44
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.

Ronak Rathod
  • 6,322
  • 17
  • 42
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.

Nishan than
  • 63
  • 2
  • 8
0

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

<editor>
          <editorType>date</editorType>
    </editor>
Birjitsinh Zala
  • 1,167
  • 6
  • 19