DefaultTabSheetDataSource Constructor

Syntax

PP.Ui.DefaultTabSheetDataSource();

Description

The DefaultTabSheetDataSource constructor creates an instance of the DefaultTabSheetDataSource class.

Example

To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Create and set default data source for the table. Determine if the data source is asynchronous, load values and cell ranges to the table, and pocess the corresponding events: MeasuresLoaded and RangeLoaded:

// Create a default data source
var dataSource = new PP.Ui.DefaultTabSheetDataSource();
// Determine whether a data source is synchronous or asynchronous
console.log("Data source " + (dataSource.getIsAsync() ? "asynchronous." : "synchronous."));
// Process a value loading event
dataSource.MeasuresLoaded.add(function (sender, eventArgs) {
    var cells = eventArgs.Data.Cells;
    console.log("Number of cells with loaded values: " + cells.Cell.length);
});
// Process a range loading event
dataSource.RangeLoaded.add(function (sender, eventArgs) {
    var ranges = eventArgs.Ranges;
    for (var i in ranges) {
        var corners = ranges[i].getCorners();
        var tlc = corners.tlCoord;
        var brc = corners.brCoord;
        console.log("Range is loaded (" + tlc.rowIndex + ", " + tlc.colIndex + ")-(" + brc.rowIndex + ", " + brc.colIndex + ")");
    }
});
// Seta data source for table 
tabSheet.setDataSource(dataSource);

After executing the example default data source is set for the table, and the table looks as follows:

The browser console shows a message informing that the default data source is synchronous, and also displays the number of cells with the loaded values and the list of loaded ranges:

The data source is synchronous.

Number of cells with loaded values: 0

Loaded range: (0, 0)-(6, 4)

See also:

TabSheetAdjustmentMgr