Can i custom views title into dropdown button in schedule?

Hi.
This is the first time i use schedule. So i have a problem to solve. I want to custom these views title, combine them into a dropdown button which have many options for select and when selected option the button title will changed based on the option i just selected.
Hope to receive a reply as soon as possible.


1 Reply 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team May 7, 2021 11:37 AM UTC

Hi DlegendS, 

Greetings from Syncfusion Support..! 

We have prepared a sample based on your shared image, using actionBegin and actionComplete events of our Scheduler, which can be viewed from the following link. 


  onActionBegin(args: ActionEventArgs): void { 
    if (args.requestType === 'toolbarItemRendering') { 
      let arg = args as any; 
      let userIconItem = { 
        template: '<input type="text" tabindex="0" id="dropdown" />', 
        type: 'Input' 
      }; 
      arg.items.push(userIconItem); 
    } 
  } 
  onActionComplete(args: ActionEventArgs): void { 
    let dropdowns = this.scheduleObj.element.querySelector('#dropdown') as any; 
    if (args.requestType === 'toolBarItemRendered') { 
      let dropdown = new DropDownList({ 
        popupHeight: '200px', 
        value: 'Week', 
        change: function(event) { 
          var view = (document.querySelector('.e-schedule') as any) 
            .ej2_instances[0]; 
          view.currentView = event.value; 
        }, 
        fields: { text: 'text', value: 'value' }, 
        dataSource: [ 
          { text: 'Day', value: 'Day' }, 
          { text: 'Week', value: 'Week' }, 
          { text: 'WorkWeek', value: 'WorkWeek' }, 
          { text: 'Month', value: 'Month' } 
        ] 
      }); 
      dropdown.appendTo(dropdowns); 
    } 
  } 

.e-toolbar-right { 
  display: none !important; 

Kindly try the above solution and get back to us if you need any further assistance. 

We will be happy to assist you..! 

Regards, 
Hareesh 


Marked as answer
Loader.
Up arrow icon