Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento grid disable sorting and filtering

How to disable sorting and filtering on a column in Magento grid

like image 874
sushantsahay Avatar asked Aug 29 '11 09:08

sushantsahay


2 Answers

The easiest way is to do it in _prepareColumns() method.

  $this->addColumn('item', array(
      'header'    => Mage::helper('module')->__('Object'),
      'index'     => 'item',
      'filter'    => false,
      'sortable'  => false
  ));
like image 57
Alexei Yerofeyev Avatar answered Nov 19 '22 22:11

Alexei Yerofeyev


For Disable filter for all columns in custom grid, you can use the following methods.

Set the following methods $this->setFilterVisibility(false); in your custom Grid.php(Block) file .

 public function __construct() {
        parent::__construct();            
        $this->setFilterVisibility(false);
    }
like image 39
Kinjalkumar Prajapati Avatar answered Nov 20 '22 00:11

Kinjalkumar Prajapati