Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app/design/adminhtml/default/default/template/widget/grid.phtml
- _column->getCssProperty()
- Mage_Adminhtml_Block_Widget_Grid_Column::getCssProperty
- $this->getRenderer()->renderCss();
- Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract::renderCss
- $this->setTemplate('path/to/your/grid.phtml');
- $this->addColumn('code_here', array(
- 'header' => $this->__('label here'),
- 'index' => 'code_here',
- 'column_css_class' => 'has_dynamic_class'
- ));
- Event.observe(window, 'load', function() {
- $$('td.has_dynamic_class').each(function(elem){
- var value = $(elem).innerHTML;
- var class = calculate class here depending on 'value'
- $(elem).addClassName('class');
- })
- });
- public function getRowClass($row)
- {
- return $row->getId() == 123 ? 'selected-row-class' : '';
- }
- $this->addColumn('my_col', [
- 'header' => 'Col Name',
- 'index' => 'my_col',
- 'column_css_class' => 'my-specific-col'
- ]);
- .selected-row-class.my-specific-col {
- background-color: pink;
- }
Add Comment
Please, Sign In to add comment