I have a ListGrid that is in SectionStackSection that is hidden at startup. The ListGrid is populated with a records behind the scene by actions that occur in other panels. This all seems to work fine. When I finally do open that section, the ListGrid is properly rendered.
Sometimes, these other functions want to update the value of a record in this ListGrid rather than add new rows to the grid. I use the find method on the ListGrid's getRecordList() method to find the row as in the following:
When the SectionStackSection is open, everything works fine. If I never have opened the section before in the past, then the find() always returns null and I never get a chance to update the values in the Record.
I know that the record is in there somewhere, because when I open the SectionStackSection, the record shows up, but it still has the old values.
I had at one point changed the code to add a new Record when the find() method returned null. This resulted in a lot of duplicate records that show up in the listGrid while it was unopened.
Is there some other way to find the record associated by the value in the records and then update it when the listgrid has yet to be rendered/shown for the first time?
Sometimes, these other functions want to update the value of a record in this ListGrid rather than add new rows to the grid. I use the find method on the ListGrid's getRecordList() method to find the row as in the following:
Code:
Record u = listGrid.getRecordList().find("Taskid", item.getUid()); if (u != null) { ((TaskingRecord)u).update(item); }
I know that the record is in there somewhere, because when I open the SectionStackSection, the record shows up, but it still has the old values.
I had at one point changed the code to add a new Record when the find() method returned null. This resulted in a lot of duplicate records that show up in the listGrid while it was unopened.
Is there some other way to find the record associated by the value in the records and then update it when the listgrid has yet to be rendered/shown for the first time?