Ext.override(Ext.grid.GridView, {
rowOverCls: 'x-grid3-row-over',
colOverCls: 'x-grid3-cell-over',
hdOverCls: 'x-grid3-hd-over',
onRowOver: function(e, t){
if(this.rowOverCls){
var row = this.findRowIndex(t);
if(row === false){
row = undefined;
}
if(this.currentRow !== row){
if(this.currentRow !== undefined){
this.removeRowClass(this.currentRow, this.rowOverCls);
}
this.currentRow = row;
if(row !== undefined){
this.addRowClass(row, this.rowOverCls);
}
}
}
if(this.colOverCls || this.hdOverCls){
var col = this.findCellIndex(t);
if(col === false){
col = undefined;
}
if(this.currentCol !== col){
if(this.currentCol !== undefined){
if(this.hdOverCls){
this.removeHdClass(this.currentCol, this.hdOverCls);
}
if(this.colOverCls){
this.removeColClass(this.currentCol, this.colOverCls);
}
}
this.currentCol = col;
if(col !== undefined){
if(this.hdOverCls){
this.addHdClass(this.currentCol, this.hdOverCls);
}
if(this.colOverCls){
this.addColClass(this.currentCol, this.colOverCls);
}
}
}
}
},
onRowOut: function(e, t){
if(this.rowOverCls && (this.currentRow !== undefined)){
this.removeRowClass(this.currentRow, this.rowOverCls);
delete this.currentRow;
}
if((this.colOverCls || this.hdOverCls) && (this.currentCol !== undefined)){
if(this.hdOverCls){
this.removeHdClass(this.currentCol, this.hdOverCls);
}
if(this.colOverCls){
this.removeColClass(this.currentCol, this.colOverCls);
}
delete this.currentCol;
}
},
addHdClass: function(col, cls){
Ext.fly(this.getHeaderCell(col)).addClass(cls);
},
removeHdClass: function(col, cls){
Ext.fly(this.getHeaderCell(col)).removeClass(cls);
},
addColClass: function(col, cls){
var rows = this.getRows();
for(var r = 0, len = rows.length; r < len; r++){
Ext.fly(Ext.fly(rows[r]).query(this.cellSelector)[col]).addClass(cls);
}
},
removeColClass: function(col, cls){
var rows = this.getRows();
for(var r = 0, len = rows.length; r < len; r++){
Ext.fly(Ext.fly(rows[r]).query(this.cellSelector)[col]).removeClass(cls);
}
}
});
CSS
.x-grid3-cell-over {background:#efefef;}
.x-grid3-row-over .x-grid3-cell-over {background:#b8cfee;}