开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜