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 7413847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:57:57+00:00 2026-05-29T06:57:57+00:00

I have a grid named ‘grid’ and onload there are rows being insert into

  • 0

I have a grid named ‘grid’ and onload there are rows being insert into the grid. Some Rows will be in green will be successfully input rows while rows with a background color of red will have errors. I had it working at some point but the error rows would be added to the grid w their background color red. Then when i tried to add a new row to enter new data into that all the rows went white. And then that stopped working all together. I’ve tried

 store.insert(0, r).addClass('error-row'); 

and

 Ext.fly(grid.getView().getRow(0)).addClass('error-row');

and

var cls ='error-row'
                            addRowClass : function(rowId, cls) {
                                            var row = this.getRow(rowId);
                                            if (row) {
                                                this.fly(row).addClass(cls);
                                            }
                                        }

and

grid.getView().getRowClass = function(record, index, rp ,store) {

                                return 'error-row';
                                     };

I’m unsure of what to do.

css

 <style>
    .error-row .x-grid-cell {
    background-color: #990000 !important;
    }

    .new-row .x-grid-cell {
    background-color: #F5F2F3 !important;
    }


</style>
  • 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-05-29T06:57:58+00:00Added an answer on May 29, 2026 at 6:57 am

    The viewConfig property should point you in the right direction – using code from Ext’s sample for grid, adding:

    • cls field to define a class for a record
    • viewConfig property to the grid’s configuration

    The code looks like this:

    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone', 'cls'],
        data:{'items':[
            { 'name': 'Lisa',  "email":"lisa@simpsons.com",  "phone":"555-111-1224", "cls":"new-row"  },
            { 'name': 'Bart',  "email":"bart@simpsons.com",  "phone":"555-222-1234", "cls":"new-row" },
            { 'name': 'Homer', "email":"home@simpsons.com",  "phone":"555-222-1244", "cls":"new-row"  },
            { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254", "cls": "error-row"  }
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        id: 'MyGrid',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            { header: 'Name',  dataIndex: 'name'},
            { header: 'Email', dataIndex: 'email', flex: 1},
            { header: 'Phone', dataIndex: 'phone'}
        ],
        viewConfig: {
            getRowClass: function(record, rowIndex, rowParams, store){
                return record.get('cls');
            }
        },
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid that has multiple rows. I want to hide/show one of
I have a grid named 'GridView1' contains two columns 'Date' and 'Session Details' I
I have two Grids inside a Stackpanel. The first grid is named as GridX.
I have a data grid view in one windows form named GridViewForm. When the
I have a button named [Filter] that I'm trying to call the grid search
I have wpf window named 'GetStarted' with grid which is perent of user control
I have a gridcontrol and there is a column named Accepted, a RepositoryItemCheckEdit is
I have a grid that is named grdUserActivity. I'm not sure what the error
I have an Ext.grid.Panel and i want to validate user input: there is a
I have one grid view that contains some template columns. In this, the first

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.