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:

A working example is available in the attachment.

Transparent update

For transparent loading of the data the fetchData method should be used.

var dataSource = supplyItemListGrid.getDataSource();

var request = {
    startRow: 0,
    endRow: (supplyItemListGrid.getVisibleRows()[1] + supplyItemListGrid.data.resultSize),
    sortBy: supplyItemListGrid.getSort(),
    showPrompt: false
};

var selectedRows = supplyItemListGrid.getSelectedState()
var callback = function(dsResponse,data,dsRequest) {
    var resultSet = isc.ResultSet.create({
        dataSource: supplyItemListGrid.getDataSource(),
        initialLength: dsResponse.totalRows,
        initialData: dsResponse.data,
        sortSpecifiers: supplyItemListGrid.getSort(),
        criteria: supplyItemListGrid.getCriteria()
    });

    supplyItemListGrid.setData(resultSet);
    supplyItemListGrid.setSelectedState(selectedRows);
};

dataSource.fetchData(supplyItemListGrid.getCriteria(), callback, request);

Attachments