have had the appoints start stacking on top of each other again and I am not sure why. I have not changed much of anything since it was working awhile ago but now it seems to not register that there are more than one appointments per cell. I have included my script for creating the appointment and also the schedule loader call. Please let me know why this might be happening and how I might look into fixing it. Thanks. If you need more information just let me know.
<script id="apptTemplate" type="text/x-jsrender">
{{if published === 'Y'}}
<div style="width=100%; height:65px !important; padding:3px; border-top: 4px solid #4fd647; color:{{>appointtextcolor}}; background:{{>appointbackcolor}};">
{{else}}
<div style="width:100%; height:65px !important; padding:3px; border-top: 4px solid #cc4542; color:{{>appointtextcolor}}; background:{{>appointbackcolor}};">
{{/if}}
<img class="apptSL ttip" data-html="true" src="assets/images/calendar/stoplight_{{>stoplight}}.png" title="Confirmed : {{>confirmed}}<br/>Staff : {{>ucount}} / {{>staff}}" alt=""/>
<div class="apptSchName">
({{>enroll}})
{{if users.length === 0}} x{{/if}}
{{if users.length === 1}} x{{/if}}
{{for users}}
{{if user_type === 'Photographer'}}
<div style="display:inline-block; border: 1px solid #ffffff; width:9px; height:9px; background-color:{{>user_color}}; border-radius:20px;"></div>
{{/if}}
{{/for}} of {{>staff}}
{{if idinfo !== '' && idinfo !== 'N'}}<i class="icon icon-price-tag2 ttip" title="{{:idinfo}}"></i>{{/if}}
{{if grpinfo !== 'N'}}
{{if grpinfo === 'Y'}}<i class="icon icon-users ttip" title="Yes, Group"></i>{{/if}}
{{if grpinfo === 'C'}}<i class="icon icon-users ttip" title="Class Group"></i>{{/if}}
{{if grpinfo === 'CS'}}<i class="icon icon-users ttip" title="Class/Staff Group"></i>{{/if}}
{{if grpinfo === 'S'}}<i class="icon icon-users ttip" title="Staff Group"></i>{{/if}}
{{if grpinfo === 'IS'}}<i class="icon icon-users ttip" title="Spring Group"></i>{{/if}}
{{if grpinfo === 'O'}}<i class="icon icon-users ttip" title="Other"></i>{{/if}}
{{/if}}
{{if evtimg !== ''}}<img class="apptEVTImg" src="{{:evtimg}}" alt=""/>{{/if}}
<br/>{{:schname}}<br/>
{{if schcode}}({{>schcode}}-{{>evtcode}}){{/if}}
{{for users}}
{{if user_type === 'Sales'}}
<div style="display:inline-block; border: 1px solid #ffffff; width:9px; height:9px; background-color:{{>user_color}}; border-radius:20px;"></div>
{{/if}}
{{/for}}
</div>
</div>
</script>
function calLoad(args,reload){
var cd = '', cv = '';
if(args.type === 'actionComplete'){
if(args.requestType !== 'viewNavigate' && args.requestType !== 'dateNavigate'){
console.log(args);
return false;
}
}
cd = funcUI.buildDate(args.model.currentDate);
sysUI.currDate = cd;
funcUI.saveSess();
funcUI.getDayStatus();
cv = args.model.currentView;
/* Handle loading events for schedule */
var apptdata = ej.DataManager({
url: "assets/includes/functionsAJAX.php?mode=getCalEventsAdm&view="+cv+"&date="+cd+"&site="+sysUI.calsite,
adaptor: new ej.UrlAdaptor()
});
var blockdata = ej.DataManager({
url:"assets/includes/functionsAJAX.php?mode=getCalBlocksAdm&view="+cv+"&date="+cd+"&site="+sysUI.calsite,
adaptor: new ej.UrlAdaptor()
});
var aPromise = apptdata.executeQuery(ej.Query());
aPromise.done(function(e){
var appts = [], data = e.result;
for(var i=0; i<data.length; i++){
appts.push({
ID: parseInt(data[i]["ID"]),
subject: data[i]["subject"],
sTime: new Date(data[i]["sTime"].replace(/-/g, '\/')),
startTime: new Date(data[i]["startTime"].replace(/-/g, '\/')),
endTime: new Date(data[i]["endTime"].replace(/-/g, '\/')),
desc: data[i]["desc"],
location: data[i]["location"],
ownerId: parseInt(data[i]["ownerId"]),
apptstat: data[i]["apptstat"],
users: data[i]["users"],
ucount: data[i]["ucount"],
schname: data[i]["schname"],
schcode: data[i]["schcode"],
staff: data[i]["staff"],
enroll: data[i]["enroll"],
evtcode: data[i]["evtcode"],
evtimg: data[i]["evtimg"],
idinfo: data[i]["idinfo"],
grpinfo: data[i]["grpinfo"],
confirmed: data[i]["confirmed"],
published: data[i]["published"],
usrcolor: data[i]["usrcolor"],
stoplight: data[i]["stoplight"],
appointtextcolor: data[i]["appointtextcolor"],
appointbackcolor: data[i]["appointbackcolor"]
});
}
$("#calendar-area").ejSchedule({appointmentSettings:{dataSource:appts}});
var bPromise = blockdata.executeQuery(ej.Query());
bPromise.done(function(e){
var blocks = [], data = e.result;
for(var i=0; i<data.length; i++){
blocks.push({
ID: parseInt(data[i]["ID"]),
subject: data[i]["subject"],
startTime: new Date(data[i]["startTime"].replace(/-/g, '\/')),
endTime: new Date(data[i]["endTime"].replace(/-/g, '\/')),
desc: data[i]["desc"],
ownerId: parseInt(data[i]["ownerId"]),
allDay: data[i]["allDay"],
isBlock: data[i]["isBlock"],
});
}
$("#calendar-area").ejSchedule({blockoutSettings:{dataSource:blocks}});
/* Handle the removal of a block date */
$('.doRemBlock').on('click touch',function(e){
e.preventDefault();
var id = $(this).attr('data-id');
if(id === 'undefined' || id === ''){new PNotify({delay:5000,text:"missing User ID. Contact Support",type:"error",opacity:.8}); return false;}
/* Do confirmation */
new PNotify({
title: 'Delete Confirmation',
text: 'Are you sure you wish to remove this date block?',
confirm:{
confirm:true,
buttons:[
{text:'Yes',click:function(notice){
/* Delete event from DB */
$.post('assets/includes/functionsAJAX.php',{'mode':'delCalEventAdm','eid':id},function(data){
notice.remove();
$('.ui-pnotify-modal-overlay').remove();
if(data.indexOf('*Error') !== -1){new PNotify({delay:5000,text:data,type:"error",opacity:.8}); return false;}
calLoad($('#calendar-area').data('ejSchedule'));
new PNotify({delay:5000,text:'Date Block has been removed',type:"success",opacity:.8});
});
}},
{text:'No',click:function(notice){
notice.remove();
$('.ui-pnotify-modal-overlay').remove();
}}
]
},
buttons:{closer:false,sticker:false},
history:{history:false},
addclass: 'stack-modal',
stack: {'dir1': 'down', 'dir2': 'right', 'modal': true}
});
});
});
});
};
$("#calendar-area").ejSchedule({
height: 600,
allowDragAndDrop: false,
showOverflowButton:false,
showCurrentTimeIndicator: false,
showAppointmentNavigator: false,
enableAppointmentResize: false,
isResponsive: false,
showLocationField: false,
showAllDayRow: false,
showTimeScale: false,
showQuickWindow: false,
timeScale: {enable: false},
cellHeight: "34px",
cellWidth: cellWd,
dateFormat: "MM/dd/yyyy",
enablePersistence: false,
enableRecurrenceValidation: false,
enableLoadOnDemand: true,
currentDate: sysUI.currDate,
firstDayOfWeek: "Monday",
dateHeaderTemplateId: "#hdrTemplate",
orientation: "horizontal",
views: ["Day","Week","Agenda"],
currentView: ej.Schedule.CurrentView.Week,
tooltipSettings: {enable: false},
resourceHeaderTemplateId: "#resTemplate",
group:{resources: ["Owners"]},
resources: [{
field: "id",
title: "Owner",
name: "Owners",
resourceSettings: {
id: "id",
isRep: "isRep",
isPhotog: "isPhotog",
isGroup: "isGroup",
isVet: "isVet",
sid: "sid",
color: "color",
appointmentClass: "cssClass",
dataSource: resdata
}
}],
blockoutSettings: {
enable: true,
templateId: "#blocktemplate",
dataSource: [],
id: "ID",
startTime: "startTime",
endTime: "endTime",
subject: "subject",
isBlockAppointment: "isBlock",
resourceId: "ownerId",
isAllDay: "allDay"
},
appointmentTemplateId: "#apptTemplate",
appointmentSettings: {
dataSource: [],
id: "ID",
title: "title",
subject: "subject",
startTime: "startTime",
endTime: "endTime",
description: "desc",
allDay: "allDay",
location: "location",
resourceFields: "ownerId"
},
create: 'calLoad',
actionComplete: 'calLoad',
beforeAppointmentRemove: function(args){return false;},
appointmentClick: 'apptEdit',
appointmentWindowOpen: function(args){return false;},
appointmentHover: function(args){return false;},
cellDoubleClick: function(args){return false;},
cellClick: function(args){
var dt = funcUI.buildDate(args.startTime);
loadQuickAdd(dt,args.resources.sid,args.resources.id);
return false;
}
});