How can I determine the view that will be displayed when the page is first opened

dhtmlxScheduler v.5.2.5 Professional


When the page is first loaded, it opens with the appearance in the first photo.


I want it to open with timeline view.

Hello @dlnatn ,

You can define the view which will be displayed after initializing the scheduler, by passing its name as the third parameter of the .init method:
https://docs.dhtmlx.com/scheduler/api__scheduler_init.html

In your case it may look like follows:

var sections=[
  {key:1, label:"Apartment 1"},
  {key:2, label:"Apartment 2"},
  {key:3, label:"Apartment 3"},
  {key:4, label:"Apartment 4"}
];

scheduler.createTimelineView({
  name:	"timeline",
  x_unit:	"day",
  x_date:	"%H:%i",
  x_step:	1,
  x_size: 7,
  x_start: 0,
  x_length: 7,
  y_unit:	sections,
  y_property:	"section_id",
  render:"bar",
  second_scale:{
    x_unit: "day", 
    x_date: "%F %d" 
  }
});



scheduler.init("scheduler_here",new Date(2020, 5, 29),"timeline");

Where timeline is the name of the timeline view.

Sample:
http://snippet.dhtmlx.com/5/675bfdd9e

1 Like