Description
ListGrid displays a list of objects in a grid, where each row represents one object and each cell in the row represents one property.
Periodical updating ListGrid is possible in the following ways:
- Use invalidateCache method. It update the data will show a loading message and will disrupt the existing view.
- Transparent update by DataSource using fetchData method. It update the data will not show a loading message and will not disrupt the existing view.
A working example is available in the attachment.
Transparent update
For transparent loading the data should be used fetchData method.
Update by DataSource
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);