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.

Color column
//<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

Common

autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
listenersEvents
maxWidthColumn
textColumn
widthColumn

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.

formulaColumn
pinnedColumn
readOnlyColumn

Accessibility

ariaLabelColumn

Export

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

Layout

alignColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Menu

Merge cells

mergeableColumn

Misc

localeClassLocalizable
localizableLocalizable
tagsColumn
treeColumn

Rendering

cellClsColumn
clsColumn
iconColumn
rendererColumn
tooltipColumn

Summary

sumColumn
summariesColumn

Properties

154

Common

autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
maxWidthColumn
textColumn
widthColumn

Class hierarchy

isColorColumn: Boolean= truereadonly
Identifies an object as an instance of ColorColumn class, or subclass thereof.
isColorColumn: Boolean= truereadonlystatic
Identifies an object as an instance of ColorColumn class, or subclass thereof.
isColumnColumn
isEventsEvents
isLocalizableLocalizable
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode

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.

$namestaticModel
defaultsColumn
elementColumn
formulaColumn
gridColumn
pinnedColumn
readOnlyColumn
relationsstaticModel
subGridColumn
typestaticColumn
visibleColumn

Accessibility

ariaLabelColumn

Editing

copyOfModel
isValidModel

Export

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

JSON

jsonModel

Layout

alignColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Menu

Merge cells

mergeableColumn

Misc

localeHelperLocalizable
localeManagerLocalizable
stmModelStm
tagsColumn
treeColumn

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Rendering

cellClsColumn
clsColumn
iconColumn
rendererColumn
tooltipColumn

Summary

sumColumn
summariesColumn

Functions

77

Configuration

applyDefaultsstaticBase

Editing

copyModel
getDataModel
removeModel
setModel

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase
optionalLstaticLocalizable

Other

hideColumn
LstaticLocalizable
onEvents
relayAllEvents
showColumn
toggleColumn
triggerEvents
unEvents

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Events

5

Event handlers

5

Typedefs

2

CSS variables

5
NameDescription
--b-color-column-border-widthColor box border
--b-color-column-border-colorColor box border color
--b-color-column-picker-widthWidth of the color column picker
No
--b-color-column-empty-border-widthColor box border width when no color is selected
--b-color-column-empty-border-colorColor box border color when no color is selected