I have added a custom column in sales order grid, and it is also coming in export CSV file but at the first position.

But I want to add it after id column (any place after id column) in CSV export file, id should be always first column in CSV file.

Below is the code to add column in custom module 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">
<listingToolbar name="listing_top"/>
<columns name="sales_order_columns">
    <column name="billing_telephone">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Telephone</item>

What should I add in above code so that Telephone column will come after id column in export file?

  • Please try to add sortorder in your above code. – Dharmendra Jadav Jul 18 '18 at 14:21
  • I tried <item name="sortOrder" xsi:type="number">20</item>, but still column coming at first. – Vinaya Maheshwari Jul 19 '18 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.