I am using DataSource.updateCaches() to add new records to a ListGrid based on events received from the server. This is working when the ListGrid is not grouped by one of the columns, but it doesn't seem to show the new records when the ListGrid is grouped. Here is my update code:
The DataSource is bound to a REST API that returns records as JSON. When I get an event from the server telling me that a new record is available, I'm using the DataSource to query the server for the single record and then I'm attempting to inject it into the datasource by faking a DSResponse to an ADD DSOperation and calling updateCaches(). This works fine unless the ListGrid is grouped. If it's grouped, the code runs without exceptions, but the ListGrid doesn't update.
What am I doing wrong?
Browser: Internet Explorer 8.0.7601.17514
GWT: 2.3.0
SmartGWT: 2.4
James
Code:
public void onJobAdded(JobAddedEvent event) { String jobId = event.getJobId(); Criteria criteria = new Criteria(); criteria.addCriteria("jobId",jobId); dataSource.fetchData(criteria, new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest originalRequest) { DSRequest request = new DSRequest(); request.setOperationType(DSOperationType.ADD); dataSource.updateCaches(response, request); } }); }
What am I doing wrong?
Browser: Internet Explorer 8.0.7601.17514
GWT: 2.3.0
SmartGWT: 2.4
James
Comment