Mage_Adminhtml_Block_Tax_Rate_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Tax_Rate_Grid:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getRowUrl ($row)

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 26 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 29 of file Grid.php.

00030     {
00031         parent::__construct();
00032         $this->setSaveParametersInSession(true);
00033         $this->setDefaultSort('region_name');
00034         $this->setDefaultDir('asc');
00035     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 37 of file Grid.php.

00038     {
00039         $rateCollection = Mage::getModel('tax/calculation_rate')->getCollection()
00040             ->joinRegionTable();
00041 
00042         $this->setCollection($rateCollection);
00043         return parent::_prepareCollection();
00044     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 46 of file Grid.php.

00047     {
00048         $this->addColumn('code', array(
00049             'header'        => Mage::helper('tax')->__('Tax Identifier'),
00050             'header_export' => Mage::helper('tax')->__('Code'),
00051             'align'         =>'left',
00052             'index'         => 'code',
00053             'filter_index'  => 'main_table.code',
00054         ));
00055 
00056         $this->addColumn('tax_country_id', array(
00057             'header'        => Mage::helper('tax')->__('Country'),
00058             'type'          => 'country',
00059             'align'         => 'left',
00060             'index'         => 'tax_country_id',
00061             'filter_index'  => 'main_table.tax_country_id',
00062             'renderer'      => 'adminhtml/tax_rate_grid_renderer_country',
00063             'sortable'      => false
00064         ));
00065 
00066         $this->addColumn('region_name', array(
00067             'header'        => Mage::helper('tax')->__('State/Region'),
00068             'header_export' => Mage::helper('tax')->__('State'),
00069             'align'         =>'left',
00070             'index'         => 'region_name',
00071             'filter_index'  => 'region_table.code',
00072             'default'       => '*',
00073         ));
00074 
00075         $this->addColumn('tax_postcode', array(
00076             'header'        => Mage::helper('tax')->__('Zip/Post Code'),
00077             'align'         =>'left',
00078             'index'         => 'tax_postcode',
00079             'default'       => '*',
00080         ));
00081 
00082         $this->addColumn('rate', array(
00083             'header'        => Mage::helper('tax')->__('Rate'),
00084             'align'         =>'right',
00085             'index'         => 'rate',
00086             'type'          => 'number',
00087             'default'       => '0.00',
00088             'renderer'      => 'adminhtml/tax_rate_grid_renderer_data',
00089         ));
00090 
00091         $this->addExportType('*/*/exportCsv', Mage::helper('tax')->__('CSV'));
00092         $this->addExportType('*/*/exportXml', Mage::helper('tax')->__('XML'));
00093 
00094         return parent::_prepareColumns();
00095     }

getRowUrl ( row  ) 

Definition at line 97 of file Grid.php.

00098     {
00099         return $this->getUrl('*/*/edit', array('rate' => $row->getTaxCalculationRateId()));
00100     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:05 2009 for Magento by  doxygen 1.5.8