문제

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'
        ]
    );
도움이 되었습니까?

해결책

Move size into style class

 $this->addColumn('productcost', ['label' => __('Voucher Cost'),'class' => 'required-entry validate-number','style' => 'width:50px']);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top