I have applied filed validation in system.xml file it is working for other fields but not applying on Dynamic fields.
Here is my Dynamic Field:
<field id="add_item" translate="label" sortOrder="15" showInDefault="0" showInWebsite="1" showInStore="0">
<label>Set Dropdown Prices</label>
<frontend_model>Vendor\Module\Block\Adminhtml\Menu\Field\AdditionalItem</frontend_model>
<backend_model>Vendor\Module\Block\Adminhtml\Menu\Config\Backend\AdditionalItem</backend_model>
<validate>validate-digits</validate>
</field>
Update
Here is my column in Frontend Model:
$this->addColumn(
'productcost',
[
'label' => __('Voucher Cost'),
'size' => '150px',
'class' => 'required-entry'
]
);
asked Apr 25, 2019 at 7:05
Ajwad Syed
1,60130 silver badges63 bronze badges
1 Answer 1
Move size into style class
$this->addColumn('productcost', ['label' => __('Voucher Cost'),'class' => 'required-entry validate-number','style' => 'width:50px']);
answered Apr 25, 2019 at 7:29
Arunprabakaran M
3,52817 silver badges32 bronze badges
-
required-entry class is already in my frontend model but it has no effect, please see the update in questionAjwad Syed– Ajwad Syed2019年04月25日 09:14:51 +00:00Commented Apr 25, 2019 at 9:14
-
Kindly share error logArunprabakaran M– Arunprabakaran M2019年04月25日 09:21:49 +00:00Commented Apr 25, 2019 at 9:21
-
Yes moving size in style worked for me.. Can u tell how to limit the number of dynamic rows like we should extend it up to 20 rows..Ajwad Syed– Ajwad Syed2019年04月25日 09:37:33 +00:00Commented Apr 25, 2019 at 9:37
-
Good question Ajwad Taqvi. Kindly post as another question.Arunprabakaran M– Arunprabakaran M2019年04月25日 09:49:25 +00:00Commented Apr 25, 2019 at 9:49
-
Posted: magento.stackexchange.com/questions/272414/…Ajwad Syed– Ajwad Syed2019年04月25日 10:22:27 +00:00Commented Apr 25, 2019 at 10:22
default