I use below code to highlight a cell in an ExtJS grid
Ext.fly(TargetCell, "ID").highlight("CCFF33", {
attr: "background-color",
开发者_开发技巧 duration: 5
});
It works well except that after highlight the cell will not return to original color and even the cell line were gone. Illustrated in below images, notice the second row Pending changed to Sold then the row line and background color became white
http://img231.imageshack.us/img231/2601/beforeextfly.jpg
http://img847.imageshack.us/img847/857/afterextfly.jpg
Any idea how to fix this? Thanks!
You can use a css class. A quick rough example would be...
myGrid.on('rowclick', function (grid, rowindex) {
var view = grid.getView();
if (view.getRow(this.currentIndex)) {
Ext.fly(view.getRow(this.currentIndex)).removeClass('highlight');
}
Ext.fly(view.getRow(rowindex)).addClass('highlight');
this.currentIndex = rowindex;
}, this);
精彩评论