Answer the question
In order to leave comments, you need to log in
How to create multiple bulk grid actions?
I need to implement multiple bulk actions in grid
.
I implement one delete action like this:
protected function _prepareMassaction()
{
$this->setMassactionIdField('entity_id');
$this->getMassactionBlock()->setFormFieldName('entity_id');
$this->getMassactionBlock()->addItem('delete', array(
'label' => $this->__('Delete'),
'url' => $this->getUrl( '*/*/massDelete'),
));
return $this;
}
protected function _prepareMassaction()
{
$this->setMassactionIdField('entity_id');
$this->getMassactionBlock()->setFormFieldName('entity_id');
$this->getMassactionBlock()->addItem('delete', array(
'label' => $this->__('Delete'),
'url' => $this->getUrl( '*/*/massDelete'),
));
$this->getMassactionBlock()->addItem('submit', array(
'label' => $this->__('Aprove'),
'url' => $this->getUrl( '*/*/massAprove'),
));
return $this;
}
Delete
. Answer the question
In order to leave comments, you need to log in
You are on the right path, you are a little inattentive.
If you look closely, _prepareMassaction is purely for adding buttons, and not for processing
Other methods are already used for processing, depending on the specified method in getUrl, such as massDeleteAction(), massApproveAction()
It can also be processed not by the same controller, but by another one by changing * to specific module, controller and action method names
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question