Removing the actions tab from the GiftcardAccount admin grid

1.7k views Asked by At

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.

2

There are 2 answers

0
Anz On BEST ANSWER

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

1
Roman Snitko On

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.