Being able to custom style and format cells, columns and rows is an important grid functionality.
AdapTable provides 2 modules that can style columns (and rows):
|Format Column||Create a style, display format or cell alignment (to be used always for the column)|
|Conditional Style||Styles the column (and optiomally row) dynamically based on rules and cell values|
Where both Modules are active Conditional Style will take precedence
Many Modules have a
Style property which all reference the same Adaptable Style object. These include:
The contents of the Adaptable Style object are as follows:
All properties in the object are nullable so only set those which differ from the current default in the grid
|BackColor||Colour background of cell - provide a hex value.|
|BorderColor||Colour of cell border - provide a hex value.|
|ClassName||Name of existing Css Class; use instead of setting other object properties|
|FontSize||Size of font: 'XSmall', 'Small', 'Medium', 'Large' or 'XLarge'|
|FontStyle||Style of the font: 'Normal' or 'Italic'|
|FontWeight||Whether font appears as 'Normal' or 'Bold'|
|ForeColor||Font colour in cell - provide a hex value.|
The Style object includes a ClassName property that enables a css style name to be provided which AdapTable will use.
Other properties in the Style object will take precedence if 2 css properties are both set
User Interface Options has a collection entitled
styleClassNames, which lists all the css classes that the user is able to pick in the Style screen.
If this property is populated then forms which show the Style dialog will additionally display a dropdown containing all the values in the array.
Make sure to include a style element with the same name in your own CSS files
Checkbox Column Clicked Event
Checkbox Columns are provided by the Format Column Module
|column||Name of Column where Checkbox was clicked|
|isChecked||Whether or not the Checkbox is checked|
|primaryKeyValue||Value in Primary Key Column for row where Checkbox was clicked|
|rowData||Data in the row where the Checkbox was clicked|
Subscribing to the Event is done the same as with all Adaptable Events: