Hi Varinder,
Here is what I would suggest to you in order to achieve the desired result:
- use a global variable where to keep the start and end Date objects:
var start = null;
var end = null;
- Within the ContextMenu open event, obtain the slot data:
open: function (e) {
var menu = e.sender;
var target = $(e.target);
var text = target.hasClass("k-event") ? "" : " ";
var scheduler = $("#scheduler").getKendoScheduler();
var slot = scheduler.slotByElement(target);
start = slot.startDate;
end = slot.endDate;
menu.remove(".myClass");
menu.append([{text: text, cssClass: "myClass" }]);
}
Within the open event of the Window assign the appropriate values to the inputs:
open: function (e) {
var windowElement = e.sender.element;
var dateInput = windowElement.find("#date");
var timeInput = windowElement.find("#time");
var startTime = start.toLocaleTimeString();
var startDate = start.toDateString();
dateInput.val(startDate);
timeInput.val(startTime);
$("body").addClass("ob-no-scroll");
},
Here you could find a modified version of the Dojo sent:
http://dojo.telerik.com/ALoVexIk/5
Regards,
Veselin Tsvetanov
Progress Telerik
Progress is here for your business, like always.
Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.