开发者

Magento - hide the buttons "Reset Filter" and "Search"

开发者 https://www.devze.com 2023-03-06 19:05 出处:网络
how can I hide the buttons \"Reset Filter\" and \"Search\"开发者_高级运维 in a custom module grid ?

how can I hide the buttons "Reset Filter" and "Search"开发者_高级运维 in a custom module grid ?

Thanks.


Hide filter buttons only

To only hide "Reset filter" and "Search" buttons, but keep the header filter fields, you could override Mage_Adminhtml_Block_Widget_Grid::getMainButtonsHtml() with:

public function getMainButtonsHtml()
{
    return '';
}

Hide filter buttons and header filter fields

If you want to hide the whole filter stuff, "Reset filter", "Search" button and the header filter fields, you could use the setFilterVisibility() method of Mage_Adminhtml_Block_Widget_Grid:

$this->setFilterVisibility(false);


You can control individual buttons with:

protected function _prepareLayout()
{
    $this->unsetChild('reset_filter_button');
    $this->unsetChild('search_button');
}

There is also an export_button child too.

0

精彩评论

暂无评论...
验证码 换一张
取 消