Workbook.SelectedObsTable

Syntax

SelectedObsTable: Object

Description

The SelectedObsTable property specified object that contains information on values of selected table rows and on values of observation attributes for these cells.

Comments

Use JSON or the setSelectedObsTable method to set the property value, and the getSelectedObsTable method to get the property value.

This value contains a JSON object with the following fields: cells - information on values of selected table cells and their observation attributes, @columnCount - number of columns, @rowCount - number of rows in the table.

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and at least one observation attribute must be added to workbook data source (attributes are edited only in a desktop application).  Set a new value for this attribute:

// Get workbook properties panel
var propertyBar = workbookBox.getPropertyBarView();
// Get observation attributes panel
var observeAttributesPanel = propertyBar.getObserveAttributesPanel();
// Display and expand this panel
observeAttributesPanel.show();
observeAttributesPanel.expand();
// Get workbook data model
var workbook = workbookBox.getSource().getActiveSheet();
// Get information about selected table cells
var observationsTable = workbook.getSelectedObsTable();
// Specify a new value for observation attribute
var value = {
    c: [{
        "@att": 0,
        "@v": "12"
    }]
};
observationsTable.cells = value;
workbook.setSelectedObsTable(observationsTable);
// Refresh workbook
workbookBox.refreshAll();

After executing the example value of the first attribute in the Observation Attributes panel is set to 12:

See also:

Workbook