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.
//<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
Configs
88Common
The name of the data model field to read a cells value from.
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
Integration
Interaction
Menu
Misc
Rendering
Properties
159
Properties
159Common
The name of the data model field to read a cells value from.
Class hierarchy
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