HI,
I need to change the background color of a cell after a record has been added to the DataSource and correspondingly to the ListGrid.
When I get an "update" or "remove" operation for a record, changing the color of the row works fine, because a record with this key already exists. However if I get an "add" operation I get a null point exception. Now, I presume this is because of the async nature of gwt, so the record hasn't been added still when Im trying to access it to change the cell color. Is there a workaround this? My code is:
int recordNum = ListGrid.getRecordList().findIndex("key", record.getKey().toString());
ListGrid.getRecord(recordNum).setCustomStyle("changedCell");
ListGrid.refreshRow(recordNum);
Thanks in advance!
I need to change the background color of a cell after a record has been added to the DataSource and correspondingly to the ListGrid.
When I get an "update" or "remove" operation for a record, changing the color of the row works fine, because a record with this key already exists. However if I get an "add" operation I get a null point exception. Now, I presume this is because of the async nature of gwt, so the record hasn't been added still when Im trying to access it to change the cell color. Is there a workaround this? My code is:
int recordNum = ListGrid.getRecordList().findIndex("key", record.getKey().toString());
ListGrid.getRecord(recordNum).setCustomStyle("changedCell");
ListGrid.refreshRow(recordNum);
Thanks in advance!
Comment