How to Set width for dropdown in magento2 system configuration?
-
28-09-2020 - |
Question
I have created a custom configuration same like Magento\Braintree\Block\Adminhtml\Form\Field\Countrycreditcard.php
with some fields like
$this->addColumn(
'field',
['label' => __('Field'), 'renderer' => $this->_getAttributesRenderer(),'style' => 'width: 1000px']
);
Even if i set width in style its not working.
Please let me know how to set width.
Solution
In
Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes.php` `_toHtml
has
$this->setExtraParams('multiple="multiple"');
So with same function try to set width
setExtraParams('style="width:1000px;"');
setExtraParams
function accepts any styling or other attributes we can set for select field
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange