An event for "this row was just loaded" in GWT cell framework
I have a list of ids of rows that should be selected, but not the actual objects that will be selected. For example, I know Users 16 and 25 should be selected, but I don't have an instance representing them. This could be because they're on a different page of data that I haven't loaded yet.
I want to be able to select these users programmatically even though their data is not loaded yet. I'm implementing a function called setSelectedIds()
and it's working great - I scan all visible objects, and if their id matches one of the ids in my set, I set it Selected. Likewise, if the user changes a selection through the human interface, I catch the SelectionChangeEvent and determine whether an id should be added or removed to my backing list of ids.
The actual question:
Is there an event that's always fired when data has be开发者_如何学编程en loaded via updateRowData()
? The only thing missing from my implementation is a way to handle the loading of new data. I need to be notified when new data is loaded, so I can decide whether to select it or not. RangeChangeEvents happen to soon - those handlers are fired before the data is loaded, and selectionModel.getSelected() returns some null objects. RowCountChangeEvents only happen when the total number of rows changes. What am I missing?
Can't you implement your own SelectionModel
? When it's asked whether an object isSelected
, it compares its ID with your list of selected IDs. You could even generalize it by using the object's key (given by the ProvidesKey
) rather than an hard-coded getId
.
精彩评论