How to disable sorting and filtering on a column in Magento grid
如何禁用Magento网格中的列的排序和筛选
2 个解决方案
#1
34
The easiest way is to do it in _prepareColumns() method.
最简单的方法是在_prepareColumns()方法中执行此操作。
$this->addColumn('item', array(
'header' => Mage::helper('module')->__('Object'),
'index' => 'item',
'filter' => false,
'sortable' => false
));
#2
5
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 .
设置以下方法$ this-> setFilterVisibility(false);在您的自定义Grid.php(块)文件中。
public function __construct() {
parent::__construct();
$this->setFilterVisibility(false);
}
#1
34
The easiest way is to do it in _prepareColumns() method.
最简单的方法是在_prepareColumns()方法中执行此操作。
$this->addColumn('item', array(
'header' => Mage::helper('module')->__('Object'),
'index' => 'item',
'filter' => false,
'sortable' => false
));
#2
5
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 .
设置以下方法$ this-> setFilterVisibility(false);在您的自定义Grid.php(块)文件中。
public function __construct() {
parent::__construct();
$this->setFilterVisibility(false);
}