开发者

Ext JS 3.2.1 Grid using Ext.fly to highlight a cell after that the original cell line and color not restore?

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜