DurationColumn

A column showing the task duration. Please note, this column is preconfigured and expects its field to be of the Duration type.

The default editor is a DurationField. It parses time units, so you can enter "4d" indicating 4 days duration, or "4h" indicating 4 hours, etc. The numeric magnitude can be either an integer or a float value. Both "," and "." are valid decimal separators. For example, you can enter "4.5d" indicating 4.5 days duration, or "4,5h" indicating 4.5 hours.

Duration column
//<code-header>
fiddle.title = 'Duration column';
//</code-header>
const grid = new Grid({
    appendTo   : targetElement,
    autoHeight : true,
    width      : 400,
    columns    : [
        { field : 'name', text : 'Train route', width : 200, editor : false },
        { type : 'duration', text : 'Duration of journey', editor : false }
    ],

    store : {
        modelClass : EventModel,
        data       : [
            { id : 1, name : 'Stockholm -> Malmö', duration : 4.5, durationUnit : 'hour' },
            { id : 2, name : 'Lund -> Copenhagen', duration : 1, durationUnit : 'hour' },
            { id : 3, name : 'Gothenburg -> Stockholm', duration : 3, durationUnit : 'hour' }
        ]
    }
});

Configs

88

Common

field: String= 'fullDuration'Also a property

The name of the data model field to read a cells value from.

Setting duration as the field value for the duration column is not allowed since the field needs both a duration magnitude and unit, as supplied by for example the fullDuration field. Additionally, a custom implemented field for the duration column should return a duration object to work correctly.
autoWidthColumn
fitModeColumn
flexColumn
largeStepNumberColumn
listenersEvents
maxNumberColumn
maxWidthColumn
minNumberColumn
stepNumberColumn
textColumn
unitNumberColumn
widthColumn

Other

Set to true to display duration in short form (5d, 2mo)

Precision of displayed duration, defaults to use durationDisplayPrecision. Specify an integer value to override that setting, or false to use raw value

formatNumberColumn
formulaColumn
pinnedColumn
readOnlyColumn

Accessibility

ariaLabelColumn

Export

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

Layout

alignNumberColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Menu

Merge cells

mergeableColumn

Misc

localeClassLocalizable
localizableLocalizable
tagsColumn
treeColumn

Rendering

cellClsColumn
clsColumn
iconColumn
rendererNumberColumn
tooltipColumn

Summary

sumColumn
summariesColumn

Properties

159

Common

field: String= 'fullDuration'Also a config

The name of the data model field to read a cells value from.

Setting duration as the field value for the duration column is not allowed since the field needs both a duration magnitude and unit, as supplied by for example the fullDuration field. Additionally, a custom implemented field for the duration column should return a duration object to work correctly.
autoWidthColumn
fitModeColumn
flexColumn
largeStepNumberColumn
maxNumberColumn
maxWidthColumn
minNumberColumn
stepNumberColumn
textColumn
unitNumberColumn
widthColumn

Class hierarchy

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

Other

Set to true to display duration in short form (5d, 2mo)

Precision of displayed duration, defaults to use durationDisplayPrecision. Specify an integer value to override that setting, or false to use raw value

$namestaticModel
defaultsColumn
elementColumn
formatNumberColumn
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

alignNumberColumn
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
rendererNumberColumn
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

defaultRendererNumberColumn
hideColumn
LstaticLocalizable
onEvents
relayAllEvents
showColumn
toggleColumn
triggerEvents
unEvents

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Events

5

Event handlers

5

Typedefs

2