...
Periodical updating ListGrid is possible in the following ways:
- Use Using the invalidateCache method. It update method. This approach updates the data and will show a loading message and . However, this API will disrupt the existing view.
- Transparent update by by DataSource using using the fetchData method. It update the data will not method. This method updates the data but doesn't show a loading message and will not won't disrupt the existing view.
...
Transparent update
For transparent loading of the data the fetchData method should be used fetchData method.
Code Block | ||||
---|---|---|---|---|
| ||||
var dataSource = supplyItemListGrid.getDataSource(); var request = { startRow: 0, endRow: (supplyItemListGrid.getVisibleRows()[1] + supplyItemListGrid.data.resultSize), sortBy: supplyItemListGrid.getSort(), showPrompt: false }; var callback = function(dsResponse,data,dsRequest) { var resultSet = isc.ResultSet.create({ dataSource: supplyItemListGrid.getDataSource(), initialLength: dsResponse.totalRows, initialData: dsResponse.data, sortSpecifiers: supplyItemListGrid.getSort() }); supplyItemListGrid.setData(resultSet); }; dataSource.fetchData(supplyItemListGrid.getCriteria(), callback, request); |
...