41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
namespace Shopkeeper\VendorNotes\Block\Adminhtml\Form\Field;
|
||
|
|
|
||
|
|
use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;
|
||
|
|
use Magento\Framework\DataObject;
|
||
|
|
|
||
|
|
class VendorMapping extends AbstractFieldArray
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Prepare rendering the new field by adding all the needed columns
|
||
|
|
*/
|
||
|
|
protected function _prepareToRender()
|
||
|
|
{
|
||
|
|
$this->addColumn('vendor_name', [
|
||
|
|
'label' => __('Vendor Name'),
|
||
|
|
'class' => 'required-entry',
|
||
|
|
'style' => 'width:200px'
|
||
|
|
]);
|
||
|
|
|
||
|
|
$this->addColumn('note', [
|
||
|
|
'label' => __('Note'),
|
||
|
|
'class' => 'required-entry',
|
||
|
|
'style' => 'width:400px'
|
||
|
|
]);
|
||
|
|
|
||
|
|
$this->_addAfter = false;
|
||
|
|
$this->_addButtonLabel = __('Add Vendor Note');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Prepare existing row data object
|
||
|
|
*
|
||
|
|
* @param DataObject $row
|
||
|
|
* @throws \Magento\Framework\Exception\LocalizedException
|
||
|
|
*/
|
||
|
|
protected function _prepareArrayRow(DataObject $row): void
|
||
|
|
{
|
||
|
|
$options = [];
|
||
|
|
$row->setData('option_extra_attrs', $options);
|
||
|
|
}
|
||
|
|
}
|