Vous pouvez utiliser le rendu pour afficher des valeurs personnalisées ou pour calculer et afficher la valeur de commission.
Par exemple dans votre grille uicomponent xml
<column name="commission" class="Vender\Modulename\Ui\Component\Listing\Column\Commission">
<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">asc</item>
<item name="label" translate="true" xsi:type="string">Commission</item>
</item>
</argument>
</column>
Et votre fichier de rendu
<?php
namespace Vender\Modulename\Ui\Component\Listing\Column;
class Commission extends \Magento\Ui\Component\Listing\Columns\Column {
/**
* @var \Magento\Directory\Api\CountryInformationAcquirerInterface
*/
protected $countryInformation;
/**
* @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context
* @param \Magento\Framework\View\Element\UiComponentFactory $uiComponentFactory
* @param array $components
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\UiComponent\ContextInterface $context,
\Magento\Framework\View\Element\UiComponentFactory $uiComponentFactory,
array $components = [],
array $data = []
){
$this->countryInformation = $countryInformation;
parent::__construct($context, $uiComponentFactory, $components, $data);
}
/**
* Prepare Data Source
*
* @param array $dataSource
* @return array
*/
public function prepareDataSource(array $dataSource) {
if (isset($dataSource['data']['items'])) {
$fieldName = $this->getData('name');
foreach ($dataSource['data']['items'] as & $item) {
//do your stuff and set value of commission in here
}
}
return $dataSource;
}
}