I'm facing one problem that is related to telerik RadScheduler,when I try to move appointment from one resource to another then radscheduler event called OnClientAppointmentMoveEnd javascript function twice.
I am not sure, Is there any internal thread is calling during move appointment?
Please help in this.
Any suggestions?
What I have tried:
I have removed all server side event and make ajax call for move appointment to another resource.
function OnClientAppointmentMoveEnd1(sender, args) {
var scheduler = null;
scheduler = sender;
try {
hideActiveToolTip();
if ($("#<%=hdnEditeTicket.ClientID%>").val() == 'N') {
noty({ text: 'You do not have permission!', type: 'warning', layout: 'topCenter', closeOnSelfClick: true, timeout: 1000, theme: 'noty_theme_default', closable: false, dismissQueue: true });
args.set_cancel(true);
}
else {
var appt = args.get_appointment();
var list = appt.get_attributes();
var attrAssigned = list.getAttribute('assigned');
var _NewStartDate = args.get_newStartTime();
var todaysDate = getFormattedString(_NewStartDate);
var NewTimeSlotIndex = args.get_targetSlot().get_index();
var TicketId = appt._id;
var resource = args.get_targetSlot().get_resource();
var workername = resource.get_text();
if (appt != null && list != null && attrAssigned != null && NewTimeSlotIndex != null) {
if (attrAssigned == "4") {
noty({ text: 'It is not allowed to move the completed ticket.', type: 'warning', layout: 'topCenter', closeOnSelfClick: true, timeout: 500, theme: 'noty_theme_default', closable: false, dismissQueue: true });
args.set_cancel(true);
}
else if (attrAssigned != "4") {
if (confirm('Do you really want to move ' + appt._subject + ' ?')) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "ScheduleBoard.asmx/AppointmentMove",
data: '{ "TicketId" : "' + TicketId + '", "TimeSlotIndex": "' + NewTimeSlotIndex + '", "StartTime": "' + todaysDate + '", "workername" : "' + workername + '" }',
dataType: "json",
async: false,
success: function (data) {
console.log(data.d);
},
error: function (result) {
alert(result.responseText);
},
failure: function (result) {
alert(result.responseText);
}
});
args.set_cancel(true);
}
else {
args.set_cancel(true);
}
}
} else { args.set_cancel(true); }
//RadScheduler Event
<telerik:radscheduler id="RadScheduler1" runat="server" skin="Material" cssclass="RadScheduler1" rendermode="Lightweight"
showheader="true"
showfooter="false"
width="99%" height="630px" shownavigationpane="true"
customattributenames="id"
displaydeleteconfirmation="false"
allowdelete="false"
starteditinginadvancedform="false"
startinsertinginadvancedform="false"
showalldayrow="true"
enableexacttimerendering="true"
onclientappointmentcontextmenu="OnClientAppointmentContextMenu"
onclientappointmentmoveend="OnClientAppointmentMoveEnd1"
<="" telerik:radscheduler="">