cancel
Showing results for 
Search instead for 
Did you mean: 

Adding custom column to order list is causing an error. But same code works in products list.

Adding custom column to order list is causing an error. But same code works in products list.

I can't seem to add a custom column using configuration and class that word on the product listing.  Any of you experience this issue?  The column I want to add is just basically checking if order id exists on another table, if it does, then output "Yes", else "No".  Thats it.

 

Call to undefined method Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider::addField()

 

I am pretty sure the code below works because its the same code I used to add column to the products listing page in admin:

<?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" class="Magento\Catalog\Ui\Component\Listing\Columns">
        <column name="is_rahaha_order" class="Rahaha\AdminSample\Ui\Component\Listing\Column\IsRahahaOrder">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="add_field" xsi:type="boolean">true</item>
                    <item name="label" xsi:type="string" translate="true">Is Rahaha Order</item>
                    <item name="sortOrder" xsi:type="number">75</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>