gwtsmartgwtlistgrid

Smart GWT List Grid - Setting a hilite to a list grid on record click


I'm trying to set a hilite inside the record click handler of the list grid. I have tired the following code,

My hilites are as follows,

 public static Hilite[] getWayBillSetHilites() {
        return new Hilite[]{
                new Hilite() {
                    {
                        setFieldNames("RECORD_VIEWED_STATUS");
                        setCriteria(new Criterion("RECORD_VIEWED_STATUS", OperatorId.EQUALS, "TRUE"));
                        setCssText(Constant.Css.TEXT_ITALIC_GRAY_32);
                        setTextColor("font-style:italic;color:#525252;");
                        setId("0");
                    }
                }
        };
    }

record click handler of the grid appears as follows,

     grid.addRecordClickHandler(new RecordClickHandler() {
        @Override
        public void onRecordClick(RecordClickEvent recordClickEvent) {
            //gridWayBillSetGrid.getHiliteState()
            //make RECORD_VIEWED_STATUS value "true"
            recordClickEvent.getRecord().setAttribute("RECORD_VIEWED_STATUS", true);
            gridWayBillSetGrid.enableHilite("0", true);

        }
    });

But when I click on the record, the styles are not showing up. Please be kind to advise on this.


Solution

  • I think it's the wrong use case for hilites. Use getCellCSSText instead.