Announcement

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

    Refresh Row in a ListGrid

    Hi,

    i have a simple list grid, where i would like to update some records
    this is my code, how it i do it
    Code:
    // init
    RecordList recordList;
    listGrid.setData(recordList = new RecordList());
    ....
    
    // update the record
    ListGridRecord r = ...
    r.setAttribute("foo", "new value");
    ...
    
    // now update the view
    listGrid.refreshRow(recordList.indexOf(r));
    actually it works fine, unless i do a "group by" over the header menu of my list grid. in that case some "rows" are added to the view, and than the above method does not work any more, because the index of the record in the recordlist does not match the row in the list grid
    the only thing, i can do now is to call markForRedraw() for the entire list grid, which, i guess, is not the most elegant way, i do not want to update the whole component, but just a row...

    is there any way to do it however?

    SmartClient Version: SC_SNAPSHOT-2011-12-05/LGPL Development Only (built 2011-12-05)

    thanks in advance
    andre
    Last edited by a.reiter; 15 Mar 2012, 03:36.

    #2
    ah, got it...

    listGrid.getRecordIndex(r);
    instead of
    recordList.indexOf(r)

    does the trick, which is actually total undestandable :-)

    Comment

    Working...
    X