Versions Compared
Version | Old Version 2 | New Version 3 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Class graphomate.ui.tables.RowFormatConfiguration
extends sap.ui.core.Element
Quick Start
Creates a table that can be used in layouts and other container components. The graphomate table is highly customizable due to its large amount of properties and aggregationsRowFormatConfugation object that defines detailed styling of rows and cells depending on data value conditions.
Code Block | ||||
---|---|---|---|---|
| ||||
var table = new graphomate.ui.tables.Table({}); |
FIXME: Bild und Code einfügen.
Constructor Details
new graphomate.ui.tables.Table(id?:string, settings?:object)
Accepts an id and a settings object or one or none of them. The settings object defines initial property values as well as aggregated and associated objects. Every setting can also be set using the related setter method. The supported settings are:
Properties:
Display
- width : sap.ui.core.CSSSize (default: "800px")
- height : sap.ui.core.CSSSize (default: "300px")
- rowOrder : graphomate.ui.tables.enums.RowOrder (default: "preOrder")
- showDatatypesInCells : boolean (default: false)
- showDatatypesInHeader : boolean (default: true)
- fixedHeader : boolean (default: false)
- showFilterHelper : boolean (default: false)
General
visible: {type: "boolean", defaultValue: true, group: "General"},
label: {type: "string", defaultValue: "", group: "General"},
rowFormatConfigType: {type: "graphomate.ui.tables.enums.RowFormatConfigType", defaultValue: "style", group: "General"},
Condition
sourceColumnId: {type: "string", defaultValue: "", group: "Condition"},
targetColumnId: {type: "string", defaultValue: "", group: "Condition"},
operator: {type: "graphomate.ui.tables.enums.Operator", defaultValue: "4", group: "Condition"},
operand1: {type: "float", defaultValue: 0, group: "Condition"},
operand2: {type: "float", defaultValue: 1, group: "Condition"},
Exception
exceptionColor: {type: "graphomate.ui.types.HexColor", defaultValue: "#8cb400", group: "Exception"},
exceptionFillType: {type: "graphomate.ui.enums.FillType", defaultValue: "filled", group: "Exception"},
exceptionShape: {type: "graphomate.ui.tables.enums.ExceptionShape", defaultValue: "0", group: "Exception"},
NumberFormat
labelFormatMode: {type: "graphomate.ui.enums.LabelFormatMode", defaultValue: "basic", group: "NumberFormat"},
basicNumberFormat: {type: "string", defaultValue: "0.0a", group: "NumberFormat"},
basicNumberFormatPercent: {type: "string", defaultValue: "0.0%", group: "NumberFormat"},
Datatype
datatype: {type: "string", defaultValue: "", group: "Datatype"},
/* EditableContent */
editableContentBackgroundColor: {type: "graphomate.ui.types.HexColor", defaultValue: "#eeeeee", group: "EditableContent"},
/* CssClass */
cssClassName: {type: "string", defaultValue: "rowFormatConfig", group: "CssClass"},
/* CssStatement */
cssStatement: {type: "string", defaultValue: "", group: "CssStatement"}
Aggregations:
- rows : graphomate.ui.tables.Row[] (default: [])
- columns : graphomate.ui.tables.DataColumn[] || graphomate.ui.tables.DeviationColumn[] (default: [])
- extendedNumberFormat : graphomate.ui.ExtendedNumberFormat (default: null)
- extendedNumberFormatPercent : graphomate.ui.ExtendedNumberFormat (default: null)
- rowFormatConfigurations : graphomate.ui.tables.RowFormatConfiguration[] (default: null)
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.
- setSampleProperty(value) - Sets the property to the passed value if valid and returns this for method chaining.
- getSampleProperty() - Returns the current value of the property.
The Following Properties are available:
Property Name | Type | Description |
---|---|---|
width | sap.ui.core.CSSSize | Sets the width of the table. e.g.: "800px" |
height | sap.ui.core.CSSSize | Sets the height of the table. |
Aggregation Details
We decided to use aggregation over association for all managed items of the graphomate table because they can be bound to a model and associations can't. The disadvantage of using an aggregation is that a managed item can only be part of one aggregation. So the instance of an extendedNumberFormat for example can be part of an aggregation of table 1 but can't be part of an aggregation of table 2 while it is still part of table 1.
Items of an aggregation named "sampleThings" that has a cardinality of 0...n (and a multiplicity of 1:n) can be accessed by using one of the following methods:
- indexOfSampeThing(object) - Searches for the provided object in the aggregation and returns its 0-based index if found, or -1 otherwise.
- getSampleThings() - Returns an array with the objects contained in the aggregation or an empty array.
- addSampleThing(object) - Adds the provided object as last element in the aggregation. Returns this for method chaining.
- insertSampleThing(object, index) - Inserts the provided object into the aggregation at position i. Returns this for method chaining.
- removeSampleThing(object) - Removes the provided object from the aggregation. Returns the removed object.
- removeAllSampleThings() - Removes all objects from the aggregation. Returns an array of all removed objects.
- destroySampleThings() - Destroys all currently aggregated objects and clears the aggregation. Returns this for method chaining.
The Item of an aggregation named "sampleThing" that has a cardinality of 0...1 (and a multiplicity of 1:1) can be accessed by using one of the following methods:
- getSampleThing() - Returns the current aggregated object or null.
- setSampleThing(object) - Sets the provided object as the new aggregated object. Returns this for method chaining.
- destroySampleThing() - Destroys the current aggregated object and clears the aggregation. Returns this for method chaining.
The following aggregations are available:
Aggregation Name | Aggregated Object Type | Cardinality | Description |
---|---|---|---|
rows | graphomate.ui.tables.Row | 0...n | A list of Row instances which provide information like hierarchy level, row title and the actual data of the row. When using rows of multiple hierarchy levels, the order of rows in this aggregation must be post order or pre order. This is necessary for the table to build a nested hierarchy from the flat aggregation list. For pre order the following order is valid (described schematically, starting at top level node with hierarchy level 0): [0,1,1,0,1,1]. A non valid order would be [1,0,1,1,0,1,1]. |