Recently, but, note, in ExtJs 6.6.0, if you want to keep the background colors of hovering and highlighting, see the following sencha fiddle: https://fiddle.sencha.com/#view/editor&fiddle/2p5c .
Here is the code:
Ext.application({ name: 'Fiddle', launch: function () { Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['name', 'email', 'phone'], data: [{ name: 'Lisa', email: ' lisa@simpsons.com ', phone: '555-111-1224' }, { name: 'Bart', email: ' bart@simpsons.com ', phone: '555-222-1234' }, { name: 'Homer', email: ' homer@simpsons.com ', phone: '555-222-1244' }, { name: 'Marge', email: ' marge@simpsons.com ', phone: '555-222-1254' }] }); Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [{ text: 'Name', dataIndex: 'name' }, { text: 'Email', dataIndex: 'email', flex: 1 }, { text: 'Phone', dataIndex: 'phone' }], height: 200, width: 400, renderTo: Ext.getBody(), viewConfig: { getRowClass: function (record, rowIndex, rowParams, store) { // console.log(record); // if (this.isSelected(record)) // return ''; return (record.get('name') == 'Lisa') ? 'redBackground' : ''; } }, // features: [{ // ftype: 'rowbody', // getAdditionalData: function (data, idx, record, orig) { // // Use the data/record to determine which class to apply, then // // style the row body in CSS. // // console.log(data); // // console.log(record); // console.log(orig); // // if (data.name == 'Lisa') // // return { // // rowBodyCls: "redBackground" // // }; // return orig; // } // }] }); } });
Style:
.x-grid-item:not(.x-grid-item-selected):not(.x-grid-item-over) .redBackground .x-grid-cell { background-color: #ffe6e6; }