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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tooltip Template ${if()}

Thread ID:





143348 Mar 15,2019 08:30 AM UTC Mar 18,2019 08:46 AM UTC ASP.NET Core - EJ 2 1
Tags: Scheduler
Asked On March 15, 2019 08:30 AM UTC

Hi, I've been trying to get my conditions to work for the past hour, only to realise that the Sample is actually kind of "cheating".

My tooltip template contains this amongst others:
${if(Location !== null)}(tags removed) ${Location} ${/if}

If Location is in fact null, "null" is printed on the tooltip.

In your sample, you have a similar condition, checking for "City". If set City to null for any of the appointments there, e.g. for "Server Maintenance" (document.getElementById("schedule").ej2_instances[0].eventsData[0].City = null), then it's actually the same. It only works because all of the items have the City property set.

Could you please advise whether your sample is wrong or this is bug?

Nevitha Ravi [Syncfusion]
Replied On March 18, 2019 08:46 AM UTC

Hi Stefan, 

Greetings from Syncfusion Support. 

We have checked the reported scenario at our end and in the shared online demo link we have checked whether the City field is empty string(‘’) or undefined which is the cause for displaying null if we directly set null to the City field. To check null we need add the following highlighted code. 
<script id="toolTip" type="text/x-template"> 
        <div class="tooltip-wrap"> 
            <div class="image ${EventType}"></div> 
            <div class="content-area"> 
                <div class="name">${Subject}</></div> 
                ${if(City && City !== null && City !== undefined)}<div class="city">${City}</div>${/if} 
                <div class="time">From&nbsp;:&nbsp;${StartTime.toLocaleString()} </div> 
                <div class="time">To&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;${EndTime.toLocaleString()} </div> 

Kindly check the solution at your end and let us know if you need further assistance. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon