I've added some fields in a form using an array as source:

        'return_type', 'select',
            'name'  => 'return_type',
            'label' => $this->__('Return type'),
            'values' => Mage::getModel('modulename/source_returntype')->toOptionArray()

Now I'd like to show that values in the grid instead of the index, should I use a Render Class or there is a simpler method?


1 Answer 1


I solved creating a _toOption() function to use inside the addColumn grid method:

                'header'  => 'return_type',
                'index' => 'return_type',
                'type' => 'options',
                'options' => $this->_toOptions(Mage::getModel('modulename/source_returntype')->toOptionArray())


protected function _toOptions($optArray){
        foreach ($optArray as $option){
            $options[$option['value']] = $option['label'];

  • The other solution is create the function toArray in Mage::getModel('modulename/source_returntype') and process data with format.
    – jruzafa
    Mar 2, 2016 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.