I would like to have a ListGrid control that automatically updates whenever the DataSource that it is attached to changes. Is there any way to do that?
Thank you,
Keith Gee
I would like to have a ListGrid control that automatically updates whenever the DataSource that it is attached to changes. Is there any way to do that?
Thank you,
Keith Gee
All ListGrids attached to DataSources automatically update when changes are made to that DataSource. Read about it in the ResultSet Class overview in the SmartClient Reference.
Maybe auto update means something else?
Here is my ListGrid:
<isomorphic:loadDS ID=“ds”/>
isc.ListGrid.create({
ID: “contactsList”,
left: 50, top: 50,
width: 500,
dataSource: ds
});
contactsList.fetchData({});
Now if I go to the adminConsole and remove a row from the grid, the above ListGrid control unfortunately does NOT reflect the change. It continues to show exactly the same information as it did when it loaded. I would like the ListGrid to automatically reflect changes made to the underlying data source.
Thanks
Hi Keithgee,
Sorry, by automatic updates we thought you meant the cache sync mechanism supports by the ResultSet.
To continuously stream updates down to all connected browsers you’ll need to use the SmartClient Messaging module (or a similar solution).
In outline:
on the server-side, centrally trap all updates to the relevant DataSource
send a message through SmartClient Messaging to indicate the change, eg, using JMS
on the client-side, handle the message by making the corresponding change to ListGrid.data, directly