DataColumn

Class graphomate.ui.tables.DataColumn


extends graphomate.ui.tables.AbstractColumn


Quick Start

Creates a DataColumn object that is based on graphomate.ui.tables.AbstractColumn and provides information like the title, width and datatype of a column. Unlike the DeviationColumn that adds calculated values to the table, a DataColumn describes the values already set by the rows. Therefore the number of DataColumns in the aggregation "columns" of a Table should correspond to the length of the Rows' list "dataPerColumn".

Usage Example
jQuery.sap.require("graphomate/ui/DatatypeDictionary");
jQuery.sap.require("graphomate/ui/tables/Table");

var dtd = new graphomate.ui.DatatypeDictionary();

var table = new graphomate.ui.tables.Table({
  width: "400px",
  rows: [
    new graphomate.ui.tables.Row({
      title: "Monitors",
      hierarchyLevel: 0,
      dataPerColumn: [74800000, 65400000]
    }),
    new graphomate.ui.tables.Row({
      title: "North",
      hierarchyLevel: 1,
      dataPerColumn: [15400000, 15000000]
    }),
    new graphomate.ui.tables.Row({
      title: "South",
      hierarchyLevel: 1,
      dataPerColumn: [59400000, 50400000]
    }),
    new graphomate.ui.tables.Row({
      title: "Tablets",
      hierarchyLevel: 0,
      dataPerColumn: [117900000, 108400000]
    }),
    new graphomate.ui.tables.Row({
      title: "North",
      hierarchyLevel: 1,
      dataPerColumn: [70100000, 53900000]
    }),
    new graphomate.ui.tables.Row({
      title: "South",
      hierarchyLevel: 1,
      dataPerColumn: [47800000, 54500000]
    })
  ],
  columns: [
    new graphomate.ui.tables.DataColumn({
      title: "ACT",
      datatype: "AC"
    }),
    new graphomate.ui.tables.DataColumn({
      title: "BUD",
      datatype: "BU"
    })
  ]
});



Constructor Details

new graphomate.ui.tables.DataColumn(id?:string, settings?:object)

Accepts an id and a settings object or one or none of them. The settings object defines initial property values. Every setting can also be set using the related setter method. The supported settings are all settings inherited from the base class graphomate.ui.tables.AbstractColumn and the following additional ones:

Properties:
  • datatype: string (default: "")




Property Details

Each property "sampleProperty" can be set using the related setter "setSampleProperty". Each setter expects a valid value for the related property as input parameter and throws an exception for invalid values. It returns the "this context" for method chaining. Each property "sampleProperty" can also be gotten using the related getter method "getSampleProperty". It expects no input parameters and returns the current value of the related property. Each property that represents or partially contains indices excepts a 0 based index.

The following properties are available:

Property NameTypeDescription
datatypestringSets the name of the column's datatype. A Datatype describes the appearance of the column's header and has to be defined using the global DatatypeDictionary. The style definition of the datatype will then be applied to all DataColumns of that datatype and to all DeviationColumns whose calculation bases on them.