Grid column types in Magento

I recently had to implement a new grid in Magento, and I wasn’t sure what should I write to the type parameter:

protected function _prepareColumns()
{
      $this->addColumn('some_column_id', array(
              'header' => Mage::helper('core')->__('Some column name'),
              'index' => 'some_column_index',
              'type' => '???',
      ));
...

So I made a little bit of research to find out all the types available. I don’t want to go in details, so here is the list:

  • action
  • checkbox
  • concat
  • country
  • currency
  • date
  • datetime
  • input
  • interface
  • ip
  • longtext
  • massaction
  • number
  • options
  • price
  • radio
  • select
  • store
  • text
  • theme
  • wrapline

You will find all these types in /app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer folder. You can also make your own grid types similarly.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.