setDefaultSort('region_name'); $this->setDefaultDir('asc'); $this->setId('tax_rate_grid'); $this->setSaveParametersInSession(true); } protected function _prepareCollection() { $rateCollection = Mage::getModel('tax/calculation_rate')->getCollection() ->joinRegionTable(); $this->setCollection($rateCollection); return parent::_prepareCollection(); } protected function _prepareColumns() { $this->addColumn('code', array( 'header' => Mage::helper('tax')->__('Tax Identifier'), 'header_export' => Mage::helper('tax')->__('Code'), 'align' =>'left', 'index' => 'code', 'filter_index' => 'main_table.code', )); $this->addColumn('tax_country_id', array( 'header' => Mage::helper('tax')->__('Country'), 'type' => 'country', 'align' => 'left', 'index' => 'tax_country_id', 'filter_index' => 'main_table.tax_country_id', 'renderer' => 'adminhtml/tax_rate_grid_renderer_country', 'sortable' => false )); $this->addColumn('region_name', array( 'header' => Mage::helper('tax')->__('State/Region'), 'header_export' => Mage::helper('tax')->__('State'), 'align' =>'left', 'index' => 'region_name', 'filter_index' => 'region_table.code', 'default' => '*', )); $this->addColumn('tax_postcode', array( 'header' => Mage::helper('tax')->__('Zip/Post Code'), 'align' =>'left', 'index' => 'tax_postcode', 'default' => '*', )); $this->addColumn('rate', array( 'header' => Mage::helper('tax')->__('Rate'), 'align' =>'right', 'index' => 'rate', 'type' => 'number', 'default' => '0.00', 'renderer' => 'adminhtml/tax_rate_grid_renderer_data', )); $this->addExportType('*/*/exportCsv', Mage::helper('tax')->__('CSV')); $this->addExportType('*/*/exportXml', Mage::helper('tax')->__('Excel XML')); return parent::_prepareColumns(); } public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('rate' => $row->getTaxCalculationRateId())); } }