Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Changing row color after an .ADD operation to a DataSource

    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!

    #2
    If you've done an asynchronous operation to add the row (such as addData()), use DataChanged to detect that it has been added.

    Comment


      #3
      Ok, I will try that tomorrow, thanks!

      Comment

      Working...
      X