We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Default date click to timeline day

Currently, the calendar component I am using has Month, Agenda, Timeline Week, and Timeline Day views injected. The default behavior for the monthly calendar is to go to the day view when clicking on the date, however, we do not include the day view as part of the calendar so nothing happens when you try to select the dare. Is there a way to default that to the timeline day view?

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team June 3, 2019 09:41 PM

Hi Brett, 
 
Syncfusion greetings. 
 
Using renderCell and actionComplete events, we prepared the sample to navigate to TimelineDay view when the date is clicked in Month view. 
 
this.change = false; 
 
onRender(args) { 
    if (args.element.classList.contains('e-work-cells') && this.scheduleObj.currentView === "Month") { 
      args.element.children[0].onclick = this.ChangeView.bind(this); 
    } 
  } 
  ChangeView(e) { 
    this.scheduleObj.selectedDate = new Date(parseInt(e.target.parentElement.getAttribute('data-date'))); 
    this.scheduleObj.currentView = "TimelineDay"; 
    this.change = true; 
  } 
  Complete(args) { 
    if (args.requestType == "viewNavigate" && this.change) { 
      this.scheduleObj.currentView = "TimelineDay"; 
      this.change = false; 
    } 
  } 
<ScheduleComponent width='100%' height='550px' ref={schedule => this.scheduleObj = schedule} selectedDate={new Date(2018, 1, 15)} eventSettings={{ dataSource: this.data }} renderCell={this.onRender.bind(this)} actionComplete={this.Complete.bind(this)} currentView='Month'> 
 
 
Regards, 
Karthi 
 
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon