Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

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:

  • Using the invalidateCache method. This approach updates the data and will show a loading message. However, this API will disrupt the existing view.
  • Transparent update by DataSource using the fetchData method. This method updates the data but doesn't show a loading message and won't disrupt the existing view.

A working example is available in the attachment.

Transparent update

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

Update by DataSource
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

  File Modified
You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.
No files shared here yet.
  • Drag and drop to upload or browse for files
    • No labels