/** * Add columns to grid * * @return Mage_Adminhtml_Block_Widget_Grid */ protected function _prepareColumns() { parent::_prepareColumns(); $this->removeColumn('customer_firstname'); $this->removeColumn('customer_lastname'); $this->addColumnAfter('agreement_label', array('header' => Mage::helper('sales')->__('Agreement Label'), 'index' => 'agreement_label', 'type' => 'text'), 'status'); $this->addColumnAfter('name', array('header' => Mage::helper('customer')->__('Name'), 'index' => 'name', 'type' => 'text'), 'customer_email'); // $status = $this->getColumn('status'); // $status->setData('frame_callback', [$this, 'decorateStatus']); $createdAt = $this->getColumn('created_at'); $createdAt->setData('index', 'created_at'); $createdAt = $this->getColumn('updated_at'); $createdAt->setData('index', 'updated_at'); $this->sortColumnsByOrder(); return $this; }
/** * Remove some columns and make other not sortable * * @return Mage_Adminhtml_Block_Widget_Grid */ protected function _prepareColumns() { $result = parent::_prepareColumns(); foreach ($this->_columns as $key => $value) { if (in_array($key, $this->_columnsToRemove)) { unset($this->_columns[$key]); } } return $result; }
/** * Remove some columns and make other not sortable * * @return Mage_Adminhtml_Block_Widget_Grid */ protected function _prepareColumns() { $result = parent::_prepareColumns(); foreach ($this->getColumns() as $key => $value) { if (in_array($key, $this->_columnsToRemove)) { $this->removeColumn($key); } } return $result; }