disable inline edit column in magento 2

Disable Inline edit column in Magento 2

Sometimes we have a requirement to disable inline edit column for the core grid or some third-party extension grid.

In today’s blog, I will show you how we can do that by just overriding the ui_component file. For this tutorial, I am disabling the email field for the customer grid.

[lwptoc]

Step 1: Create a Simple Module

For this customization, we need a custom module Rk_DisableEdit where we can define our ui_component file. Follow this link for how to  Create Module in Magento 2

Step 2: Create a customer_listing.xml

The customer_listing.xml file used in the core module Magento_Customer to create a grid for the customer and define all the columns and datasource for the grid.

Create a system.xml file at app/code/Rk/DisableEdit/view/adminhtml/ui_component/customer_listing.xml and add the below code.

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
        <column name="email" sortOrder="40">
            <settings>
                <editor>
                    <editorType>false</editorType>
                </editor>
            </settings>
        </column>
    </columns>
</listing>

Hope you find this Tutorial is helpful. Do comment if you face any issue or Contact me If you want any help or customization in your existing Project or Extension.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top