1

我有一个 ListGrid,我为所有工作正常的单元格分配了 hilite[] 。

但是现在当我选择那个特定的单元格/记录时,我已经改变了单元格的颜色。

我创建了如下hilites。此处所选单元格的颜色不会变为蓝色。但一开始它的绿色或红色。请帮忙

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");
                }
            }
    };
4

0 回答 0