TableColumnSelector
The object for defining conditions that apply a conditional style to a column.
Declaration
object TableColumnSelectorProperties
| Name | Type | Description |
|---|---|---|
columnIndex | integer | A number that specifies a column index. The leftmost column of data has an index of |
descriptor | string | A number that specifies the When |
even | boolean | A Boolean value when |
odd | boolean | A Boolean value when |
Discussion
Use the TableColumnSelector object to set the criteria for applying conditional styles to columns. For example, you could set the criteria to select all even columns or to select columns for certain data descriptors.
You can use this object in ConditionalTableColumnStyle.
Example
{
"components": [
{
"role": "datatable",
"style": "bookTableStyle",
"showDescriptorLabels": true,
"sortBy": [
{
"descriptor": "id-publication-date",
"direction": "ascending"
}
],
"data": {
"descriptors": [
{
"identifier": "id-publication-date",
"key": "publicationDate",
"label": "Date",
"dataType": "string"
},
{
"identifier": "id-title",
"key": "title",
"label": "Title",
"dataType": "string"
},
{
"identifier": "id-publisher",
"key": "publisher",
"label": "Publisher",
"dataType": "string"
}
],
"records": [
{
"title": "Mardi",
"publicationDate": "1849",
"publisher": "Harper & Brothers"
},
{
"title": "Typee",
"publicationDate": "1846",
"publisher": "Wiley and Putnam"
},
{
"title": "White-Jacket",
"publicationDate": "1850",
"publisher": "Harper & Brothers"
},
{
"title": "Omoo",
"publicationDate": "1847",
"publisher": "Harper & Brothers"
},
{
"title": "Redburn",
"publicationDate": "1849",
"publisher": "Harper & Brothers"
},
{
"title": "Moby-Dick",
"publicationDate": "1851",
"publisher": "Harper & Brothers"
}
]
}
}
],
"componentStyles": {
"bookTableStyle": {
"tableStyle": {
"columns": {
"backgroundColor": "#eeeeee",
"conditional": [
{
"selectors": [
{
"columnIndex": 0
}
],
"backgroundColor": "#dddddd"
}
]
},
"headerCells": {
"padding": 5,
"textStyle": {
"fontWeight": "bold"
}
},
"cells": {
"padding": 2
}
}
}
}
}