I have below code.
magento\app\code\Custom\Module\Block\Adminhtml\Index.php
protected function _construct() {
$this->addButton('select', array(
'before_html' => '<form name="frm" id="frm" method="post" action=""><input name="form_key" type="hidden" value="' . $this->getFormKey() . '"/>',
'label' => __('Select'),
'type' => 'submit',
'name' => 'select',
'id' => 'select',
'value' => 1,
'after_html' => '</form>',
));
}
magento\app\code\Custom\Module\Block\Adminhtml\Module\Grid.php
protected function _prepareColumns() {
$this->addColumn(
'id', [
'header_css_class' => 'a-center',
'type' => 'checkbox',
'name' => 'id',
'align' => 'center',
'index' => 'id',
'values' => array(3,4),
]
);
$this->addColumn(
'qty_succeed[]', [
'header' => __('Qty'),
'type' => 'input', // Change to Input
'index' => 'qty_succeed',
'editor' => 'text',
]
);
}
I'm not using _prepareMassaction
function as I'm not able to achieve needed functionality.
When clicked on "Select" button it should pass all values in Array so I can validate in Controller.
Question 1 How to add form on listing portion only? Because _prepareMassaction
is not taking textbox values. It only takes checkbox values
Question 2 How to select main checkbox as well from Listing?