ColorColumn
A column that displays color values (built-in color classes or CSS colors) as a colored element similar to the ColorField. When the user clicks the element, a ColorPicker lets the user select from a range of colors.
//<code-header>
fiddle.title = 'Color column';
//</code-header>
// grid with ColorColumn
const grid = new Grid({
appendTo : targetElement,
// makes grid as high as it needs to be to fit rows
autoHeight : true,
data : DataGenerator.generateData(5),
columns : [
{ field : 'name', text : 'Name', flex : 1 },
{ type : 'color', field : 'color', text : 'ColorColumn', width : 100, colors : DataGenerator.colors }
]
});new Grid({
columns : [
{
type : 'color',
field : 'color',
text : 'Color'
}
]
});
Configs
84
Configs
84Common
Other
Adds an option in the picker to set no background color
By default, the color code (hex value etc.) is stored in the record field. If you want to store the color
name instead, set this to true.
The colors property can be an array of string CSS colors or of objects with color
and text properties from which the user can choose from. This will override the
pickers default colors.
Provide an array of string CSS colors:
new Grid({
columns : [
{
type : 'color',
field : 'color',
text : 'Color',
colors : ['#00FFFF', '#F0FFFF', '#89CFF0', '#0000FF', '#7393B3']
}
]
});
Show the color name in addition to a colored swatch.
Integration
Interaction
Menu
Misc
Rendering
Properties
154
Properties
154Common
Class hierarchy
Other
Adds an option in the picker to set no background color
By default, the color code (hex value etc.) is stored in the record field. If you want to store the color
name instead, set this to true.
The colors property can be an array of string CSS colors or of objects with color
and text properties from which the user can choose from. This will override the
pickers default colors.
Provide an array of string CSS colors:
new Grid({
columns : [
{
type : 'color',
field : 'color',
text : 'Color',
colors : ['#00FFFF', '#F0FFFF', '#89CFF0', '#0000FF', '#7393B3']
}
]
});
Show the color name in addition to a colored swatch.
Editing
Integration
Interaction
JSON
Menu
Misc
Parent & children
Rendering
Functions
77
Functions
77Configuration
Editing
Events
Identification
Misc
Other
Parent & children
Events
5
Events
5Event handlers
5
Event handlers
5Typedefs
2
Typedefs
2CSS variables
5
CSS variables
5| Name | Description |
|---|---|
--b-color-column-border-width | Color box border |
--b-color-column-border-color | Color box border color |
--b-color-column-picker-width | Width of the color column picker |
| No | |
--b-color-column-empty-border-width | Color box border width when no color is selected |
--b-color-column-empty-border-color | Color box border color when no color is selected |