1

I want to add class to the magento admin custom grid filter dropdown.

I have dropdown in one filter column and I dont want to use JS to reduce client side load.

Is there anyway to add class while preparing column to the grid.php?

$this->addColumn('mfg', array(
   'header' => Mage::helper('manufacturer')->__('Manufacturer'),
   'index' => 'mfg_id',
   'filter_index' => 'SFOIA.mfg_id',
   'type' => 'options',
   'options' => $this->getManufacturersWithExtraOption(),
   'filter_condition_callback' => array($this, '_manufacturerCallback'),
));

I dont want add class to the column - Need class to the filter dropdown only. just in to its html

Thank you

1 Answer 1

1

this is good way to add class in your custom column

$this->addColumn('mfg', array(
            'header' => Mage::helper('manufacturer')->__('Manufacturer'),
            'index' => 'mfg_id',
            'filter_index' => 'SFOIA.mfg_id',
            'type' => 'options',
            'options' => $this->getManufacturersWithExtraOption(),
            'filter_condition_callback' => array($this, '_manufacturerCallback'),
            'column_css_class' => 'your_class'
        ));

column_css_class allows you to add a class to the columns that hold values.

1
  • Thanks for the help but it adds class to the <td> tag. I want to add class to the filter <select> tag.
    – Mansi Raja
    Feb 27, 2019 at 10:31

Your Answer

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

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