Tooltip only on subject

Hello,
I'm trying to view the tooltip containing my ToolTip template, only when mouse hover on the subject, intestad when mouse hover on every point of appointment.
it is possible?

thanks

3 Replies 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team October 9, 2020 11:38 AM UTC

Hi Gabriele Guidi, 
 
Greetings from Syncfusion Support. 
 
We have analyzed your requirement “Tooltip only on subject” at our side and let you know that we can achieve it by making use of the dataBound event of the scheduler and beforeRender event of the tooltip like the below code snippet. 
 
Code snippet: 
function onBound() {  
    var tooltipObj = document.querySelector('.e-schedule').ej2_instances[2] 
    tooltipObj.target = ".e-subject"; 
    tooltipObj.beforeRender = function (args) { 
        if (args.target.parentElement.classList.contains('e-appointment-details')) { 
            var schObj = document.querySelector('.e-schedule').ej2_instances[0]; 
            var tooltipObj = document.querySelector('.e-schedule').ej2_instances[2]; 
            var Internationalization = new ej.base.Internationalization(); 
            var appData = schObj.getEventDetails(args.target.parentElement.parentElement); 
            var content = "<div><div class='subject'>" + appData.Subject + "</div>" + 
                "<div class='start_time'>" + Internationalization.formatDate(appData.StartTime, { type: 'dateTime', skeleton: 'short' }) + "</div>" + 
                "<div class='end_time'>" + Internationalization.formatDate(appData.EndTime, { type: 'dateTime', skeleton: 'short' }) + "</div></div>"; 
            tooltipObj.content = content; 
        } else { 
            args.cancel = true; 
        } 
    }; 
} 
 
 
Kindly try the above solution and let us know if this is helpful. 
 
Regards, 
Balasubramanian S

Marked as answer

GG Gabriele Guidi October 16, 2020 01:23 PM UTC

Thank you very much Balasubramanian Sattanathan,
with the necessary corrections to adapt it to my project it works fine.


NR Nevitha Ravi Syncfusion Team October 19, 2020 06:20 AM UTC

Hi Gabriele, 

You are most welcome 😊 , please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon