2

I want to add a new column in my existing custom admin grid:

My columns in admin grid are:enter image description here

also I want this column to appear in edit listing page.

0

In

view/adminhtml/ui_component/listing.xml

Add this code to create new column.

<column name="name">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">text</item>
                </item>
                <item name="label" xsi:type="string" translate="true">Name</item>
                <item name="visible" xsi:type="boolean">false</item>
            </item>
        </argument>
    </column>

Also, the name of the column must be the same as the database column field. So it will automatically retrieve data from the database.

The same Thing goes for Editing page. Add the Same Column in Edit form. if you want to create a field in existing database, you need to run UpgradeScheme script for this. https://magento.stackexchange.com/a/238655/66990

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.