Removing the actions tab from the GiftcardAccount admin grid
-
26-10-2019 - |
Question
In the magento admin control panel,
Customers = > GiftCardAccounts
I want to remove the actions tab containing the select options which is located below the pagination section. To be clear, I just want to remove the section displaying, Select All | Unselect All | Select Visible | Unselect Visible | 0 items selected and Action list option from the Manage Gift Card Accounts grid. Please let me know how to do this exactly.
Solution 2
I found an easy way to do this, override the Enterprise_GiftCardAccount_Block_Adminhtml_Giftcardaccount_Grid
and just comment the method protected function _prepareMassaction()
.
location : \app\code\local\Enterprise\GiftCardAccount\Block\Adminhtml\Giftcardaccount\Grid.php
This Works like a CHAMP. :-D
OTHER TIPS
You can use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract::setUseSelectAll()
method.
Just take a look at example in Mage_Adminhtml_Block_Sales_Invoice_Grid::_prepareMassaction()
$this->getMassactionBlock()->setUseSelectAll(false);
So, you need to override core block Enterprise_GiftCardAccount_Block_Adminhtml_Giftcardaccount_Grid
, and change method _prepareMassaction
.
protected function _prepareMassaction()
{
$this->setMassactionIdField('giftcardaccount_id');
$this->getMassactionBlock()->setFormFieldName('giftcardaccount');
$this->getMassactionBlock()->setUseSelectAll(false); // here is your update
$this->getMassactionBlock()->addItem('delete', array(
'label'=> Mage::helper('enterprise_giftcardaccount')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete'),
'confirm' => Mage::helper('enterprise_giftcardaccount')->__('Are you sure you want to delete these gift card accounts?')
));
return $this;
}
However, this will hide only Select All/Unselect All links.
If you want to completely remove this block, you should override app/design/adminhtml/default/default/template/widget/grid/massaction.phtml
template.