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

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

Thread ID:

Created:

Updated:

Platform:

Replies:

127698 Dec 3,2016 02:05 PM Dec 5,2016 11:57 PM ASP.NET MVC 3
loading
Tags: Gantt
Renu
Asked On December 3, 2016 02:05 PM

Hi,

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.
Ex:
 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);">
        <div>
            {{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 
https://www.syncfusion.com/kb/2723/how-to-create-a-custom-tooltip-template-in-gantt
 @(Html.EJ().Gantt("gantt")
        // ...
       .TaskbarTooltipTempate(“<table><tbody><tr><td>BuildStage :</td><td>{{:~_stageName()}}</td> </tr></tbody></table>”)
      // ...
        )   
<script type=”text/javascript”>
$.views.helpers({_stageName: getStageName });   
    &a

Jonesherine Stephen [Syncfusion]
Replied On December 5, 2016 06:55 AM

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: 
[view]     
@(Html.EJ().Gantt("GanttContainer"). 
       .TaskbarTemplate("#taskbarTemplate") 
       .ParentTaskbarTemplate("#parentTaskbarTemplate") 
       .MilestoneTemplate("#milestoneTemplate") 
    ) 
    @(Html.EJ().ScriptManager()) 
    <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}}/> 
                                 //… 
    </script> 
     
[controller] 
            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.   
Regards, 
Jone sherine P S 


Renu
Replied On December 5, 2016 11:50 AM

Hi Jone sherine,

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

Regards,
Renu


Jonesherine Stephen [Syncfusion]
Replied On December 5, 2016 11:57 PM

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


CONFIRMATION

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.

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.

;