We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

positioning of appointments & tooltip



I have 2 questions about the Schedule module

1. I am using an appointment template to increase the height of the appointment cells to include more text and images, however when I do that the appointments layer on each other because you auto set them with a top value that matches YOUR height not my templates height. And there seems to be no real way to make that change with multiple appts in a cell. I want them to stack on each each at my height. See included image (sorry for the poor drawing capabilities)

2. The tooltip you have does not take into account the calendar being farther down the page than the top. it appears farther down than it should it looks like when it is calculating where the mouse is that it is not subtracting my header on the top of the page so it is about an inch off of where it should be. I have also included that on the image I sent you with an arrow pointing to the box the mouse was hovering over (since the cursor did not show up on screen grab)

Any help would be wonderful, thanks

Attachment: Capture_a119a981.zip

11 Replies

MP Mahesh Palanisamy Syncfusion Team July 11, 2016 05:08 PM UTC

Hi David, 

Thank you for contacting Syncfusion support. 
 
Please find the below responses for your queries -  
 
Query 1: appointments layer on each other 
 
We regret to let you know that we are unable to reproduce the reported issue and suspect that the appointments CSS may got overridden by the appointment template style. To check it with our side, we need the following details from your side – 
-          Share us the sample code snippets that you have used to render the Scheduler 
-          Share us the release version that you are currently using 
-          Also, if possible provide us with the full size image that covers the entire Scheduler, as we couldn’t clearly recognize whether it is in vertical or horizontal orientation, or else it uses multiple resources. 
 
Query 2: Positioning of tooltip 
 
Here, we suspect that your application layout container may override the default tooltip position calculation. For reproducing this issue, we require you to share the complete code snippet of Scheduler and how you have defined tooltip content for it. Also, please share the CSS which you have used for the parent container within which you have placed the Scheduler. 
 
Since, we are unable to reproduce the above two issues, kindly share us with our requested sample or code block or the entire schedule full image to proceed further on this and provide better solution. 

Regards, 
Mahesh 



DB David Barrett July 11, 2016 06:14 PM UTC



Thanks for the reply,

I am using the latest version of the ej.web.all.js (14.2.0.26)

I have included a better image to show the whole calendar and drew a circle around the overlap that I am talking about in the appointments. I have included the calendar page below. I am using the lastest bootstrap css/js for v3 with no specific overrides than what you see in the code for the both the appointments and the tooltip.  There is a relatively placed navbar above the container-fluid that is 100px in height. Thats it to the page as you will see in image. The only override I have is to make sure that the appointment box height is 50px. I hope this data helps get a better picture. Thanks

.user_appt {
  1. height50px !important;

<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<button class="btn btn-xs btn-default pull-right cal-menu"><i class="icon icon-menu2"></i></button>
<h4 class="panel-title text-left">Portal Calendar</h4>
</div>
<div class="panel-body" style="height:600px; position:relative;">
<div id="calendar-area"></div>
<div id="addevent-area">
<button class="btn btn-info btn-3d btn-sml cancelEvent pull-right mb-15">Cancel</button>
<button class="btn btn-success btn-3d btn-sml addEvent pull-right mr-15 mb-15">Save Event</button>
</div>
</div>
</div>
</div>

<script id="tooltipTmpl" type="text/x-jsrender">                 
    <div>
        <div>Name: {{:subject}}</div>
        <div>Event: {{:desc}}</div>
        <div>StartTime: {{:startTime}}</div>
        <div>EndTime: {{:endTime}}</div>
    </div>        
</script>
<script id="resTemplate" type="text/x-jsrender">
<div style="height:100%">
<div class="usr-clr-box" style="background-color:{{:color}}"></div>
{{if isRep === 'Y'}}<i class="icon icon-coins ttip" title="Sales Rep"></i>{{/if}}
{{if isPhotog === 'Y'}}<i class="icon icon-camera ttip" title="Photographer"></i>{{/if}}
{{:title}}
</div>
</script>
<script id="apptTemplate" type="text/x-jsrender">
<div style="color:{{:appointtextcolor}}; background:{{:appointbackcolor}}; height:100%;">
{{:subject}}<br/>
{{:startTime}} - {{:endTime}}
</div>
</script>
<script type="text/javascript">
/* Handle cancel event button on add page */
$('body').on('click','.cancelEvent',function(e){
e.preventDefault();
$('#addevent-area').slideToggle();
$('#calendar-area').slideToggle(); 
    });
    /* Handle loading resources for schedule */
var resdata = ej.DataManager({
   url:"assets/includes/functionsAJAX.php?mode=getResource",
adaptor: new ej.UrlAdaptor()
});
/* Handle loading events for schedule */
function calLoad(args){
var dManager = ej.DataManager({
            url: "assets/includes/functionsAJAX.php?mode=getCalEvents",
            adaptor: new ej.UrlAdaptor()
        });
        //dManager.adaptor = new ej.UrlAdaptor();
        var queryPromise = dManager.executeQuery(ej.Query());
        queryPromise.done(function(e){
            var appointments = [], data = e.result;
            for(var i = 0; i < data.length; i++){
                appointments.push({ 
                ID: parseInt(data[i]["ID"]), 
                subject: data[i]["subject"], 
                //allDay: parseInt(data[i]["allDay"]), 
                startTime: new Date(data[i]["startTime"]), 
                endTime: new Date(data[i]["endTime"]),
                desc: data[i]["desc"],
            location: data[i]["location"],
            ownerId: parseInt(data[i]["ownerId"]),
            appointtextcolor: '#5f6467',
            appointbackcolor: '#e0ebfa'
                });
            }
            console.log(appointments);
            $("#calendar-area").ejSchedule({ appointmentSettings: { dataSource: appointments } });
            $('.e-horizontresheaderdiv').find('td:first-child').css('width','0px');
        });
   
    /* Handle building calendar */
$("#calendar-area").ejSchedule({
height: "100%", 
allowDragAndDrop: false,
showOverflowButton:false,
showCurrentTimeIndicator: false, 
        showAppointmentNavigator: false,
        enableAppointmentResize: false,
showLocationField: true,
showAllDayRow: false,
        showTimeScale: false,
        timeScale: {enable: false},
        cellHeight: "50px",
        cellWidth: "300px",
        dateFormat: "MM/dd/yyyy",
enablePersistence: true,
enableLoadOnDemand: true,
enableRecurrenceValidation: false,
isResponsive: true,
currentDate: new Date(),
orientation: "horizontal",
views: ["Day","Week","WorkWeek","Month","Agenda"],
        currentView: ej.Schedule.CurrentView.Workweek,
        tooltipSettings: {enable: true, templateId: '#tooltipTmpl'},
        resourceHeaderTemplateId: "#resTemplate",
        group:{resources: ["Owners"]},
        resources: [{
field: "ownerId",
title: "Owner",
name: "Owners", 
resourceSettings: {
text: "title", 
id: "id", 
isRep: "isRep", 
isPhotog: "isPhotog", 
groupId: "groupId",
color: "color",
appointmentClass: "cssClass",
dataSource: resdata
}
        }],
appointmentTemplateId: "#apptTemplate",
        appointmentSettings: {
            dataSource: [],
            id: "ID",
            title: 'test',
            subject: "subject",
            startTime: "startTime",
            endTime: "endTime",
description: "desc",
            allDay: "allDay",
            location: "location",
            resourceFields: "ownerId",
            appointtextcolor: "appointtextcolor"
        },
        create: "calLoad",
    cellClick: function(args){
    $('#calendar-area').slideToggle(); 
    $('#addevent-area').slideToggle();
    return false;
    },
    actionComplete: function(args){
    //console.log(args);
    $('.e-horizontresheaderdiv').find('td:first-child').css('width','0px');
    }
    });
</script>

Attachment: Capture_97376d56.zip


KK Karthigeyan Krishnamurthi Syncfusion Team July 13, 2016 01:08 PM UTC

 
Thanks for sharing your code with us. 
 
Please find the below responses for your queries. 
 
Query1: Appointment’s layer on each other  
  
We have checked and modified your code example to achieve your requirement on displaying all the appointments with your required customization (with overridden height to pass the customized content to it) one after the other without overlapping problem. In the below code example, we have used the class user_appt to apply styles for the appointment template instead of setting it’s height to 100%. Kindly try with the suggested solution and let us know if it you need further assistance. 
 
<Code> 
.user_appt { 
            height: 75px !important; 
            } 
 
<div class="user_appt"> 
            {{:Subject}}<br /> 
            {{:StartTime}} - {{:EndTime}} 
</div> 
 
$("#Schedule1").ejSchedule({ 
                height: "100%", 
                ---------- 
                ---------- 
                cellHeight: "100px", 
                ---------- 
                ---------- 
  }); 
 
</Code> 
 
Query 2: Positioning of tooltip  
 
We have created an incident for the reported problem in this query and would request you to have a follow up with the below incident link for further update on this.   
  
Please let us know, if you need any other further assistance on this.   
 
Regards, 
Karthigeyan 
 
 
 



DB David Barrett July 13, 2016 03:08 PM UTC



Thanks for the reply,

That did indeed work for what I was looking for in positioning the appointment boxes, thanks very much. 

I will follow the other issue through incident support. 

Thanks again


KK Karthigeyan Krishnamurthi Syncfusion Team July 14, 2016 04:36 AM UTC

 
We are happy to hear that your issue has been resolved.  
 
Please let us know if you need any further assistance. 
 

Regards, 
Karthigeyan 



DB David Barrett January 3, 2017 02:44 PM UTC

 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}}&nbsp;x{{/if}}
{{if users.length === 1}}&nbsp;x{{/if}}
{{for users}} 
{{if user_type === 'Photographer'}}
&nbsp;<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}}&nbsp;&nbsp;
{{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'}}
&nbsp;<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;
    }
    });




KK Karthigeyan Krishnamurthi Syncfusion Team January 4, 2017 10:18 AM UTC

Hi David,    
    
Thanks for sharing your code with us.   
  
We were unable to reproduce the issue at our end and for the same we have prepared the appointment template sample which can be viewed from the below link.   
  
We request you to reproduce the issue in a sample and revert us else share your runnable sample to proceed further.   
  
Regards,   
Karthigeyan   
 



DB David Barrett January 4, 2017 11:09 AM UTC


Im sure you can get a runnable version since I don't think its a bug since it was working on mine up til a little while ago. What I am trying to figure out is what I might have done to make the appointments not stack. Is there something that I might be interrupting that forces them all to be at a css value of top:0px

I am trying to track down what I may have messed up. I have removed all my templates, not loaded the blocks and nothing seems to change the way they are stacking up. I have also tried various version of syncfusion javascript

Any ideas on what could be interrupting this would help me greatly since I cant seem to track it down on my own


KK Karthigeyan Krishnamurthi Syncfusion Team January 6, 2017 07:05 AM UTC

Hi David,     
 
Thanks for your update. 
 
We have created an incident for your query and we request you to have a follow up with the below incident link for further update on this. 
 
Regards, 
Karthigeyan 



DB David Barrett January 6, 2017 08:51 AM UTC


Thank you for the reply. I finally figured out what the issue was this afternoon. The  resources: [{field:}] option was changed and I guess that was not letting your scripting realize how many items were already assigned there. It took me forever to figure out since I would never have looked there for that being the reason to my issue. But since it is now fixed I am all good

Thanks for the replies


KK Karthigeyan Krishnamurthi Syncfusion Team January 9, 2017 06:58 AM UTC

 
We are happy to hear that you had found the solution. 
 
Please let us know if you need further assistance. 
 
Regards, 
Karthigeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon