5

I just want to have the column in the grid but not visible.

Is it possible ? any parameter I should pass to addColumn()

16

You column can look like this:

$this->addColumn('column_id_here', array(
    'header' => Mage::helper('helper_name_here')->__('Column header here'),
    'index' => 'column_index_here',
    'column_css_class'=>'no-display',//this sets a css class to the column row item
    'header_css_class'=>'no-display',//this sets a css class to the column header
));

Basically you can use column_css_class and header_css_class to add any css classes to the column and then work your magic in the css file. In magento admin default theme no-dispaly class has 'display:none' on it.

  • 1
    It create problem when you have empty grid.It count non display column in colspan so design mess up when no record found. – Zaheerabbas Oct 17 '18 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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