I need help with this line of code.
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as & $item) {
$item[$this->getData('name')];//Value which you want to display
}
}
return $dataSource;
}
XML is,
<?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">
<column name="updated_at" class="Mvn\Cam\Ui\Component\Listing\Column\ReferralColumn">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" translate="true" xsi:type="string">Updated At</item>
</item>
</argument>
</column>
</columns>
</listing>
Error on Magento admin,
Notice: Undefined index: updated_at in C:\xampp\htdocs\Buyani\app\code\Mvn\Cam\Ui\Component\Listing\Column\ReferralColumn.php on line 31
I just want to display the updated_at
column from the database to the customer grid at Magento admin.