Problem
I need two-column table. First — simple text field and the second should be an image.
What was done
Now I have this. The second column should be an image.
Code
class Customermap extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray
{
protected $_customerGroupRenderer;
protected $_addAfter = false;
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Data\Form\Element\Factory $elementFactory,
array $data = [ ]
) {
parent::__construct($context, $data);
}
protected function _prepareToRender()
{
$this->addColumn('field1', [ 'label' => __('Адрес'), 'size' => 300 ]);
$this->addColumn('customer_group', [
'label' => __('Customer Group'),
'renderer' => $this->_customerGroupRenderer
]);
}
}
Additional information
Saw one example with something called "GroupRender", but suppose it was wrong. In source files saw some "renders" to transfer in "addColumn" method, but can't understand how to use it.