Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:33:50+00:00 2026-06-15T21:33:50+00:00

On a backend admin page with a grid I need to change the background

  • 0

On a backend admin page with a grid I need to change the background color for groups of rows. Not alternate color row by row as default but coloring groups according to a known column value.

I was looking into this SO question: Approach on changing row color on orders grid in admin and other similar pages. But can’t reproduce what I need as this question refers to a value in a column that will be repeated.

I need to either use different colors for different groups or at least use alternate colors of those groups.

Maybe something like this:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:33:52+00:00Added an answer on June 15, 2026 at 9:33 pm

    For anyone looking for a solution. I used this tutorial on the Inchoo website: Add custom renderer for a custom column in Magento grid. There are some SO questions that also helped to understand the solution.

    I didn’t manage to change the full row background color as initially wanted, I’m just modifying the cell background. But at the end, is enough to point the user that this row is somewhat different. What I have done was add a new custom column. On the renderer property I referenced a new class.

    $this->addColumn('collision_type', array(
              'header'  => $helper->__('Collision'),
              'align'   => 'center',
              'index'   => 'collision_type',
              'type'    => 'action',
              'renderer'=> new Dts_Banners_Block_Adminhtml_Collisions_Grid_Renderer_Collisiontype(),
    ));
    

    I placed the needed class inside a new subtree:

    Grid
      └─ Renderer
            └─ Collisiontype.php
    

    And this is the new class that should render the column. To have different colors just need to evaluate the $value variable and apply different color styles for the corresponding value, that is what I’m doing now.

    <?php
    class Dts_Banners_Block_Adminhtml_Collisions_Grid_Renderer_Collisiontype extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
    {
        public function render(Varien_Object $row) {
            $value =  $row->getData($this->getColumn()->getIndex());
            return '<div style="color:#FFF;font-weight:bold;background:#F55804;border-radius:8px;width:100%">'.$value.'</div>';
        }
    }
    ?>
    

    And the result:

    Screen shot of grid with rendered column

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that is part of a backend CRM admin panel. On
I have a custom module with a backend page. In the grid, I show
I am borrowing a complete eCommerce website with backend(admin) interface built in PHP from
I have a symfony 1.4 application with an admin backend, and I would like
Assume there are two separate web applications: a sports site with admin backend an
I'm using Symfony 1.4 and Doctrine. My application's backend was built using Symfony's admin
Our websites article backend does not allow access to anything above </head> which prevents
I have created a Magento admin module with it's own menu and page in
I have a rails application with 2 roles, say admin and user. But the
I've been thinking of writing my own backend, because I feel active_admin might not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.