createTimelineView

creates the Timeline view in the scheduler

void createTimelineView(object config);

Parameters

configobjectthe configuration object of the Timeline view

Available only in PRO Edition

Example

// the time scale from 8 AM to 8 PM with a 30-minute step
scheduler.createTimelineView({
     name:      "timeline",
     x_unit:    "minute",
     x_date:    "%H:%i",
     x_step:    30,
     x_size:    24,
     x_start:   16,
     x_length:  48,
     y_unit:[   
        {key:1, label:"Section A"},
        {key:2, label:"Section B"},
        {key:3, label:"Section C"},
        {key:4, label:"Section D"}  
     ],
     y_property: "section_id",
     render:    "bar"
});

Required extension: ext/dhtmlxscheduler_timeline.js
Applicable views:Timeline View

Related samples

Details

This functionality is available in the PRO edition only.

The configuration object of the Timeline view can have the following properties:

Dynamic change of properties

All defined timeline objects are stored in the scheduler.matrix object. You can access the configuration of any timeline view by its name and change any property. Changes will be applied as soon as you update the scheduler:

scheduler.getView('timeline').x_size = 12;
scheduler.setCurrentView(); // redraws scheduler

where "timeline" is the name of the timeline view as specified in the createTimelineView method:

scheduler.createTimelineView({
    name:"timeline",
    ...
});
Back to top