Infrid Infrid - 2 months ago 16
PHP Question

Magento grid column position

I'm editing the order grid by adding custom columns like this

$this->addColumn('pagamenti', array(
'header' => 'Paymentsource',
'width'=>'50px',
'align' =>'left',
'type' => 'text',
'renderer' => 'Blablabla_Adminhtml_Block_Sales_Order_Renderer_lol'
));


but every column is positioned on the far right of the table, no matter where I call addColumns.

Is there a way to force the position?

Thanks

Answer

You can probably use the addColumnAfter function.

$this->addColumnAfter('pagamenti', array(
  'header'    => 'Paymentsource',
  'width'=>'50px',
  'align'     =>'left',
  'type'    => 'text',
  'renderer' => 'Blablabla_Adminhtml_Block_Sales_Order_Renderer_lol'
), 'id_of_column_to_be_after');