Hi Gayathri,
Thanks for your update.
We have validated your reported query “Is there any way to put toggle button instead of the text used in the header” at our end. We have achieved your requirement by making use of actionBegin and actionComplete events of our scheduler and same can be available in following sample.
this.weekNumberTemplate =
'<div class="text-child" style="font-size: 14px;">Timeline Month View </div></div><div><div class="icon-child" style="text-align: center;padding-left:5px">' +
'<button id="view_name"></button></div>';
onActionBegin(args) {
if (args.requestType === "toolbarItemRendering") {
let userIconItem = {
align: "right",
template: this.weekNumberTemplate,
type: "Input"
};
args.items.push(userIconItem);
}
}
onActionComplete(args) {
let scheduleObj = document.querySelector(".e-schedule").ej2_instances[0];
let dropdowns = scheduleObj.element.querySelector("#view_name");
if (args.requestType === "toolBarItemRendered") {
let switchObj = new Switch({
checked: true,
change: this.toggleTwoMonthView.bind(this)
});
switchObj.appendTo(dropdowns);
}
}
Kindly try the above sample and get back to us if you need any further assistance.
Regards,
Vinitha