0

I am facing layout issue when I added new column in sales order Grid. For some reason filter and options are displaying below grid.

Please Refer Screenshot

enter image description here

My Code How I added the column.

etc/module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Namespace_Modulename" setup_version="1.0.0"/>
    <sequence>
        <module name="Magento_Sales" />
    </sequence>
</config>

view/adminhtml/ui_component/sales_order_grid.xml

<?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="sales_order_columns">
        <column name="my_custom_column">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="sorting" xsi:type="string">desc</item>                    
                    <item name="label" xsi:type="string" translate="true">My Custom Column</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

etc/di.xml

<virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid">
    <arguments>
        <argument name="columns" xsi:type="array">
            <item name="my_custom_column" xsi:type="string">sales_order.my_custom_column</item>
        </argument>
    </arguments>
</virtualType>

My column was added but now I am facing this layout issue.

  • Probably duplicate of this..magento.stackexchange.com/questions/134754/… – arushi Apr 28 '17 at 11:00
  • @arushi I have tried those solution that and my problem was not resolved. And do refer I don't want to know how I can add Column. I am facing issue after adding it. – Priyank Apr 28 '17 at 11:13
  • I tried your code and it works perfectly fine and as per one of the comment on that post(regarding sequence, if you tried that might be that solves the issue.) – arushi Apr 28 '17 at 11:26
  • I have tested it in 2.1.6 and I am facing this issue as shown in screenshot – Priyank Apr 28 '17 at 11:56
  • @userpk Do you checked that in app/etc/config.php your module is really after Mangeto_Sales module? – LucScu May 11 '17 at 10:10
0

I also faced same issue. After adding sequence in module.xml

<sequence>
    <module name="Magento_Sales" />
</sequence>

I upgrade the Magento.

php bin/magento setup:upgrade

And issue is resolved.

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.