setId('statsGrid'); $this->setDefaultSort('customer_id '); $this->setDefaultDir('DESC'); $this->setSaveParametersInSession(true); } protected function _prepareCollection() { $collection = Mage::getResourceModel('rewardpoints/customer_collection')->addNameToSelect(); $this->setCollection($collection); return parent::_prepareCollection(); } protected function _prepareColumns() { $this->addColumn('id', array( 'header' => Mage::helper('rewardpoints')->__('ID'), 'align' =>'right', 'width' => '50px', 'index' => 'entity_id', )); $this->addColumn('name', array( 'header' => Mage::helper('rewardpoints')->__('Customer full name'), 'align' => 'left', 'index' => 'name', )); $this->addColumn('email', array( 'header' => Mage::helper('rewardpoints')->__('Customer email'), 'align' => 'left', 'index' => 'email', )); $this->addColumn('points_current', array( 'header' => Mage::helper('rewardpoints')->__('Accumulated points'), 'align' => 'right', 'index' => 'all_points_accumulated', 'filter' => false, )); $this->addColumn('points_spent', array( 'header' => Mage::helper('rewardpoints')->__('Spent points'), 'align' => 'right', 'index' => 'all_points_spent', 'filter' => false, )); $this->addExportType('*/*/exportCsv', Mage::helper('rewardpoints')->__('CSV')); $this->addExportType('*/*/exportXml', Mage::helper('rewardpoints')->__('XML')); return parent::_prepareColumns(); } }