TableCellSelector
The object for defining conditions that apply a conditional style to a cell.
Declaration
object TableCellSelectorProperties
| Name | Type | Description |
|---|---|---|
columnIndex | integer | Specifies a column index. The leftmost column of data has an index of |
descriptor | string | Specifies the |
evenColumns | boolean | When |
evenRows | boolean | When |
oddColumns | boolean | When |
oddRows | boolean | When |
rowIndex | integer | Specifies a row index. The topmost row of data has an index of |
Discussion
Use the TableCellSelector object to set the criteria for applying conditional styles to rows. For example, you could set criteria to select a cell at a specific location or to select cells for a certain data descriptor.
You can use this object in ConditionalTableCellStyle.
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": {
"headerCells": {
"padding": 5,
"textStyle": {
"fontWeight": "bold",
"fontStyle": "normal"
}
},
"cells": {
"padding": 2,
"conditional": [
{
"selectors": [
{
"oddRows": true
}
],
"backgroundColor": "#eeeeee"
}
]
}
}
}
}
}