smart gwt remove hilite and change background color

1.4k views Asked by At

I have a ListGrid for which I have assigned hilite[] for all cells which is working fine.

But now I have change the color of the cell when I select that particular cell/record.

I have created hilites as follows. Here the color of the selected cell doesnt change to blue. But at start its green or red. Please help

Hilite[] selected = new Hilite[]{

            new Hilite() {
                {
                    setFieldNames("checkStationName");
                    //setCriteria(new Criterion("status", OperatorId.EQUALS, DetectFilesConstants.CHCK_STATUS_FAIL));
                    setCriteria(new Criterion(OperatorId.AND, new Criterion[]{
                              new Criterion("checkStationName", OperatorId.NOT, selectedRecord),
                              new Criterion("status", OperatorId.EQUALS, DetectFilesConstants.CHCK_STATUS_FAIL)       
                    }));
                    setTextColor("#FF0000");
                    setCssText("background-color: red;");
                    setId("55");
                }
            }   ,
            new Hilite() {
                {
                    setFieldNames("checkStationName");
                    //setCriteria(new Criterion("status", OperatorId.EQUALS, DetectFilesConstants.CHCK_STATUS_SUCCESS));
                    setCriteria(new Criterion(OperatorId.AND, new Criterion[]{
                              new Criterion("checkStationName", OperatorId.NOT_CONTAINS, selectedRecord),
                              new Criterion("status", OperatorId.EQUALS, DetectFilesConstants.CHCK_STATUS_SUCCESS)        
                    }));
                    setTextColor("#FF0000");
                    setCssText("background-color: #4CC417;");
                    setId("57");
                }
            }   ,
            new Hilite() {
                {
                    setFieldNames("checkStationName");
                    setCriteria(new Criterion(OperatorId.AND, new Criterion[]{
                              new Criterion("checkStationName", OperatorId.EQUALS, selectedRecord),
                              new Criterion(OperatorId.OR, new Criterion[]{
                                      new Criterion("status", OperatorId.EQUALS, DetectFilesConstants.CHCK_STATUS_FAIL),
                                      new Criterion("status", OperatorId.EQUALS, DetectFilesConstants.CHCK_STATUS_SUCCESS)
                              })}));
                    setTextColor("#FF0000");
                    setCssText("background-color: black;");
                    setId("58");
                }
            }
    };
0

There are 0 answers