Magento网格禁用排序和过滤

sus*_*hay 16 sorting grid filter magento

如何禁用Magento网格中的列的排序和筛选

Ale*_*yev 38

最简单的方法是在_prepareColumns()方法中执行此操作.

  $this->addColumn('item', array(
      'header'    => Mage::helper('module')->__('Object'),
      'index'     => 'item',
      'filter'    => false,
      'sortable'  => false
  ));
Run Code Online (Sandbox Code Playgroud)


小智 7

对于自定义网格中所有列的"禁用"过滤器,可以使用以下方法.

$this->setFilterVisibility(false);在自定义Grid.php(块)文件中设置以下方法.

 public function __construct() {
        parent::__construct();            
        $this->setFilterVisibility(false);
    }
Run Code Online (Sandbox Code Playgroud)