Notice: You are browsing the documentation for PrestaShop 9, which is currently in development.
You might want to read the documentation for the current version, PrestaShop 8. Read the current version of this page
The most basic column is DataColumn. It is used to display raw field data in Grid.
Properties | Type | Expected value |
---|---|---|
field | string | required The record field name that the column displays. |
<?php
use PrestaShop\PrestaShop\Core\Grid\Column\Type\DataColumn;
use PrestaShop\PrestaShop\Core\Grid\Column\ColumnCollection;
$dataColumn = new DataColumn('id_product');
$dataColumn->setName('ID');
$dataColumn->setOptions([
'field' => 'id_product',
]);
$columns = new ColumnCollection();
$columns->add($dataColumn);