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

How can I create a custom taskbar template like tooltip template.


I am trying to use taskbar template to display task resource pictures within taskbar.
According to the demo I can only use some static url for images.
I want to use different url's for different users.
 resoure 1: 
image url : ..\images\users\xxxx.jpg
resource 2:
url: ..\images\users\contractors\yyyyy.jpg

instead of using the standard way described in demo like below: 
<script type="text/x-jsrender" id="taskbarTemplate">
    <div class="e-gantt-template-taskbar bg-color" style="border-radius:5px;overflow:hidden;-webkit-transform:translateZ(0);-webkit-mask-image: -webkit-radial-gradient(circle, white, black);">
            {{if #data['resourceNames']}}
            <img style="position:relative;top:8px;left:4px;text-align:left;z-index:1;" height="32" width="32" src="../images/gantt/{{:#data['resourceNames']}}.png" />
I want to use as described in 
        // ...
       .TaskbarTooltipTempate(“<table><tbody><tr><td>BuildStage :</td><td>{{:~_stageName()}}</td> </tr></tbody></table>”)
      // ...
<script type=”text/javascript”>
$.views.helpers({_stageName: getStageName });   

3 Replies

JS Jonesherine Stephen Syncfusion Team December 5, 2016 11:55 AM UTC

Hi Renu, 
Thanks for contacting Syncfusion support. 
We can refer different image path while rendering custom taskbar template. 
We have prepared the work around and provided the required image path in a separate field and referred that path in taskbar template. 
Please find the code example below: 
    <script type="text/x-jsrender" id="taskbarTemplate"> 
                {{if #data['resourceNames']}} 
                <img style="position:relative;top:8px;left:4px;text-align:left;z-index:1;" height="32" width="32" src={{:#data.item.ImagePath}}/> 
            tasks[0].SubTasks[0].SubTasks.Add(new TaskDetails() 
                ResourceID = new List<object>() { 1 }, 
                ImagePath = "Content/gantt/folder1/Robert King.png" 
We have also prepared the sample based on this, please find the sample from below location 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ, Syncfusion.EJ.MVC, dlls to render the Gantt control which is available in Essential Studio installed location.   
Jone sherine P S 

RE Renu December 5, 2016 04:50 PM UTC

Hi Jone sherine,

That's what I am looking for.
Thank you.


JS Jonesherine Stephen Syncfusion Team December 6, 2016 04:57 AM UTC

Hi Renu, 
Thanks for your update 
Please let us know if you need further assistance on this, 
Jone sherine P S 

Live Chat Icon For mobile
Up arrow icon