0

I want to hide Search button from admin grid which is created using blocks and not ui component,

How should do I that?

1 Answer 1

0

The search button is added in a core file

at 

vendor/magento/module-backend/Block/Widget/Grid.php 

with function 

public function getSearchButtonHtml()
{
    return $this->getChildHtml('search_button');
}

So in my module's grid file I have added same function as follows to remove Search button

public function getSearchButtonHtml()
{
    return '';
}

Thank You.

3
  • between you should not use block for creating admin grid its outdated.. the best practice is to use ui component.
    – Pramod
    Sep 27, 2020 at 5:41
  • Hello @Pramod I have created grid inside report section so used block Sep 27, 2020 at 8:15
  • you might have only added a column over there ?
    – Pramod
    Sep 27, 2020 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.