Posted 14 September 2017, 11:11 am EST
Sorry, still not detailed enough.
The grid doesn’t know anything about the server. It only knows about the CollectionView that contains the data it is displaying. It will update the display when the CollectionView notifies.
So this really is a question about CollectionView. Now the question is how is the CollectionView communicating with the server, and who is changing the data.
If the change is made by your app, things are simple. For example, the user clicks a button that causes your code to make a change to the data. In this case, you can just call refresh on the CollectionView and that will be it:
flex.collectionView.refresh();
If the change happened on the server, then the first thing you need is some mechanism to detect the change. You can either poll the server or receive push messages (socket-style). Either way, when you know that data changed you could either reload the collection view (which it sounds like you don’t want to do) or you can get only the record that changed and update your collection view:
function dataChanged(changedItem) {
var list = flex.collectionView.sourceCollection;
var index = lookUpItemByIndex(list, changedItem);
if (index > -1) {
list[index] = changedItem; // update the item
flex.collectionView.refresh(); // refresh the view
}
}
I hope this helps.