1

In Magento 1.9 I add a column to Sales Grid using an observer. I want to show more actions instead only one action.

With my code, in my column I see a select box, with the two actions. Instead I want to see the two actions, one under the other.

This is my observer:

class VendorName_ModuleName_Model_ObserverAddColumn
{
    public function addColumnToGrid(Varien_Event_Observer $observer)
    {
        $block = $observer->getEvent()->getBlock();

        if (!($block instanceof Mage_Adminhtml_Block_Sales_Order_Grid) || $block->getNameInLayout() != 'sales_order.grid')
            return $this;

        // Add a new column rigth after the "view" column
        $block->addColumnAfter('view', [
        'header' => $block->__('Header'),
        'width' => '60px',
        'index' => 'index_example',
        'type'   => 'action',
        'sortable' => false,
        'getter'   => 'getId',
        'actions'   => array(
                array(
                        'caption'   => Mage::helper('ModuleName')->__('One'),
                        'url'       => array('base'=> 'routerName/controllerName/actionName'),
                        'field'     => 'id'
                ),
                array(
                        'caption'   => Mage::helper('ModuleName')->__('Two'),
                        'url'       => array('base'=> 'routerName/controllerName/actionName2'),
                        'field'     => 'id'
                    )
        ),
        'filter' => false
        ], 'entity_id');

       return $this;
   }

}

1 Answer 1

0

This plugin will solve all grid related problems. Please test it on development 1st. https://www.magentocommerce.com/magento-connect/enhanced-admin-grids-editor.html

1
  • Thanks but I'm searching a solution without installing another plugin..
    – Vixent
    Aug 12, 2017 at 12:30

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.