TableViewPanel.Source

Syntax

Source: PP.Exp.EaxDocument;

Description

The Source property sets the data source for the View tab.

Example 1

Executing the example requires that the HTML page contains the EaxPropertyBar component named eaxPropBar (see Example of EaxPropertyBar and EaxGrid Components Collocation). Then get an object of the TableViewPanel class, specify data source for this object, show and expand corresponding tab, and output selected values:

var items = eaxPropBar.getControl().getItems();
for (var i = 0; i < items.length; i++) {    
    if (items[i].getTypeName() == "TableViewPanel") {        
        var tableViewPanel = items[i];
        // Set data source
        PP.Object.defineProps(PP.Exp.Ui.TableViewPanel, ["Source"], eaxPropBar.getSource());
        // Show the panel
        tableViewPanel.show();
        // Expand the panel
        tableViewPanel.expand(True);
        // Get selected value in the Autofit Cells item
        console.log(tableViewPanel.getAutoFitState().mode); // "Auto"
        // Get selected value in the Layout (Columns and Rows Header) item
        console.log(tableViewPanel.getHeadersState());
        // Get selected value in the Display Hierarchy item
        console.log(tableViewPanel.getHierarchiesState().grid.columnsHierarchical);
        // Get selected value in the Sort By item
        console.log(tableViewPanel.getSortingState().pivot);
        // Get selected value in the Style and Formatting item
        console.log(tableViewPanel.getTableStyleState().PredefinedStyle);
    }
}

Executing the example sets a data source for the View tab, this tab is shown and expanded, and the values selected on the tab are displayed in the output.

Example 2

The example of property use is also given in the TableViewPanel Constructor page.

See also:

TableViewPanel