ig.OlapTableView

ig.OlapTableView_image
A view that transforms the $.ig.OlapResult into a table. The view transforms the result during its creation and will not update if the result change. Everytime a new result is retrieved a new view should be created for it.

Code Sample

<!doctype html>
<html>
<head>
    <!-- jQuery Core -->
    <script src="js/jquery.js" type="text/javascript"></script>
    <!-- jQuery UI -->
    <script src="js/jquery-ui.js" type="text/javascript"></script>
    <!-- Infragistics Combined Scripts -->
    <script src="js/infragistics.core.js" type="text/javascript"></script>
    <script src="js/infragistics.lob.js" type="text/javascript"></script>
    <script type="text/javascript">
        $.support.cors = true;                
        $(function () {
            var dataSource = new $.ig.OlapXmlaDataSource({
                serverUrl: "http://sampledata.infragistics.com/olap/msmdpump.dll",
                catalog: "Adventure Works DW Standard Edition",
                cube: "Adventure Works",
                rows: "[Date].[Calendar]",
                measures: "[Measures].[Customer Count], [Measures].[Internet Order Count]"
            });
			
            dataSource.initialize().done(function(metadataTree) {
                // the result of the pre-loaded rows, columns, filters and measures is evaluated as part of initialization 
                var result = dataSource.result();
            
                var viewSettings = {
                    isParentInFrontForColumns: true,
                    isParentInFrontForRows: true,
                    compactRowHeaders: true,
                    compactColumnHeaders: false
                };
            
                var hasColumns = dataSource.columnAxis().length > 0;
                var hasRows = dataSource.rowAxis().length > 0;

                // create and initialize the table view
                var tableView = new $.ig.OlapTableView(result, hasColumns, hasRows, viewSettings);
                tableView.initialize();
            
                // obtain layout information about result's row and column headers and its data cells
                var columnHeaders = this._tableView.columnHeaders();
                var rowHeaders = this._tableView.rowHeaders();
                var resultCells = tableView.resultCells();
            });
        });
    </script>
</head>
<body>
</body>
</html>    
    

Related Topics

Dependencies

jquery-1.9.1.js
infragistics.util.js
  • options

    Type:
    object
    Default:
    {}

    • hasColumns

      Type:
      bool
      Default:
      null

      Optional="false" a value indicating whether the result has one or more hierarchies in the columns.

    • hasRows

      Type:
      bool
      Default:
      null

      Optional="false" a value indicating whether the result has one or more hierarchies in the rows.

    • result

      Type:
      object
      Default:
      null

      Optional="false" an object of type $.ig.OlapResult.

    • viewSettings

      Type:
      object
      Default:
      {}

      Optional="false" an object containing the table view configuration options as properties.

      • compactColumnHeaders

        Type:
        bool
        Default:
        false

        Optional="false" value indicating wheter the column headers should be arranged for compact header layout - each hieararchy is in a single row.

      • compactRowHeaders

        Type:
        bool
        Default:
        true

        Optional="false" value indicating wheter the row headers should be arranged for compact header layout - each hieararchy is in a single row.

      • isParentInFrontForColumns

        Type:
        bool
        Default:
        false

        Optional="false" a value indicating whether parent for columns is in front of its children.
        If set to true the query set sorts members in a level in their natural order. Their natural order is the default ordering of the members along the hierarchy when no other sort conditions are specified.
        Child members immediately follow their parent members.
        If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents.

      • isParentInFrontForRows

        Type:
        bool
        Default:
        true

        Optional="false" a value indicating whether parent for rows is in front of its children.
        If set to true the query set sorts members in a level in their natural order. Their natural order is the default ordering of the members along the hierarchy when no other sort conditions are specified.
        Child members immediately follow their parent members.
        If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents.

The current widget has no events.
  • appliedColumnSortDirections

    .appliedColumnSortDirections( );
    Return Type:
    array
    Return Type Description:
    An array of column sort direction items, which are applied to the sorted $.ig.OlapTableView result.

    Returns the column sort direction items, which were applied during the $.ig.OlapTableView initialization.

  • appliedLevelSortDirections

    .appliedLevelSortDirections( );
    Return Type:
    array
    Return Type Description:
    An array of level sort direction items, which are applied to the sorted $.ig.OlapTableView result.

    Returns the level sort direction items, which were applied during the $.ig.OlapTableView initialization.

  • appliedSortDirectionsMap

    .appliedSortDirectionsMap( );
    Return Type:
    object
    Return Type Description:
    An object, which maps the applied sort.

    Returns a javascript object, which maps the applied level sort directions to the axis name, hierarchy index in the axis and the level depth.
    It is used internally to determine, which $.ig.OlapTableViewHeaderCell needs to display a sorting indicator in the user interface.

  • columnHeaders

    .columnHeaders( );
    Return Type:
    array
    Return Type Description:
    An array of objects of type $.ig.OlapTableViewHeaderCell.

    Returns the table column headers.

  • columnSortDirections

    .columnSortDirections( [columnSortDirections:array] );
    Return Type:
    array
    Return Type Description:
    An array of objects, which hold information for the column sort directions that will be applied when the $.ig.OlapTableView is initialized.

    Gets or sets the column sort direction items, which will be applied when the $.ig.OlapTableView is initialized.
    - tupleIndex (number): specifies the index of the tuple, which corresponds to a column in the column axis.
    - sortDirection (string: ascending|descending): indicates the sort direction for the column. The allowed values are 'ascending' (default) and 'descending'.
    - comparer (function): an optional function, which will be used to compare the cells from the column. The function should return a number:
    1. If Cell1 < Cell2, return a value lower than 0.
    2. If Cell1 == Cell2, return 0.
    3. If Cell1 > Cell2, return a value greater than 0.

    • columnSortDirections
    • Type:array
    • Optional
    • An array of objects, which have the following properties:.
  • initialize

    .initialize( );

    Initializes the table view object as its rowHeaders, columnHeaders and resultCells are created for the result object the table view is related to.
    Applies the items from the columnSortDirections and levelDortDirections to produce the sorted result.

  • levelSortDirections

    .levelSortDirections( [levelSortDirections:array] );
    Return Type:
    array
    Return Type Description:
    An array of objects, which hold information for the level sort directions that will be applied when the $.ig.OlapTableView is initialized.

    Gets or sets the level sort direction items, which will be applied when the $.ig.OlapTableView is
    - levelUniqueName (string): the name of the level to be sorted.
    - sortDirection (string: ascending|descending): indicates the sort direction for the level. The allowed values are 'ascending' (default) and 'descending'.
    - sortBehavior (string:alphabetical|system): indicates the type of sorting to be applied. The allowed values are 'alphabetical' (default) and 'system'.

    • levelSortDirections
    • Type:array
    • Optional
    • An array of objects, which have the following properties:.
  • result

    .result( );
    Return Type:
    object
    Return Type Description:
    An objects of type $.ig.OlapResult.

    Returns the sorted $.ig.OlapResult object.

  • resultCells

    .resultCells( );
    Return Type:
    array
    Return Type Description:
    An array of objects of type $.ig.OlapTableViewResultCell.

    Returns the table result cells ordered as if the grid is iterated row by row.

  • rowHeaders

    .rowHeaders( );
    Return Type:
    array
    Return Type Description:
    An array of objects of type $.ig.OlapTableViewHeaderCell.

    Returns the table row headers.

  • viewSettings

    .viewSettings( );
    Return Type:
    object
    Return Type Description:
    An object containing the table view configuration options as properties as decribed in table view constructor.

    Returns the configuration object this table view is created with.

Copyright © 1996 - 2024 Infragistics, Inc. All rights reserved.