The item data is not transferred via the hash syntax to the custom template ("tooltip-tamplate") for the tooltip. But it works for other templates "task-templat" and "column-template". Please help me to find out the solution. Below is my code in View:
<!--Style progress bar-->
<script id="task-template" type="text/x-kendo-template">
<div class="template" style="background-color: #= Color #;">
<a href="#= Link #">
<h5 style="font-family: "Open Sans",sans-serif;">#= title #<\h5>
</a>
</div>
</script>
<!--Style columns-->
<script id="column-template" type="text/x-kendo-template">
@*<i class="tio-bookmark-outlined tio-lg text-primary"></i>*@
<span>#= ProjectGenre #</span>
</script>
<!--Style ToolTip-->
<script id="tooltip-tamplate" type="text/x-kendo-template">
<div style="padding: 1rem;">
<p>Genre: #= ProjectGenre # </p>
</div>
</script>
@(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>((IEnumerable<TaskViewModel>)ViewData["tasks"], (IEnumerable<DependencyViewModel>)ViewData["dependencies"])
.Name("gantt")
.Columns(columns =>
{
columns.Bound(c => c.Studio).Title("Студія").Width(200).Sortable(true);
columns.Bound(c => c.ProjectGenre).Title("Жанр").Width(300).Sortable(true).TemplateId("column-template");
})
.Views(views =>
{
views.YearView(yearView => yearView.Selected(true));
})
.ShowWorkHours(false)
.ShowWorkDays(false)
.Editable(false)
.Height(600)
.TaskTemplateId("task-template")
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.TaskID);
m.ParentId(f => f.ParentID);
m.Field(f => f.Expanded).DefaultValue(true);
m.Field(f => f.Start).ToString();
m.Field(f => f.End).ToString();
})
)
.Tooltip(t =>
{
t.Visible(true);
t.TemplateId("tooltip-tamplate");
})
.DependenciesDataSource(d => d
.Model(m =>
{
m.Id(f => f.DependencyID);
m.PredecessorId(f => f.PredecessorID);
m.SuccessorId(f => f.SuccessorID);
})
)
)
<!--Style progress bar-->
<script id="task-template" type="text/x-kendo-template">
<div class="template" style="background-color: #= Color #;">
<a href="#= Link #">
<h5 style="font-family: "Open Sans",sans-serif;">#= title #<\h5>
</a>
</div>
</script>
<!--Style columns-->
<script id="column-template" type="text/x-kendo-template">
@*<i class="tio-bookmark-outlined tio-lg text-primary"></i>*@
<span>#= ProjectGenre #</span>
</script>
<!--Style ToolTip-->
<script id="tooltip-tamplate" type="text/x-kendo-template">
<div style="padding: 1rem;">
<p>Genre: #= ProjectGenre # </p>
</div>
</script>
@(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>((IEnumerable<TaskViewModel>)ViewData["tasks"], (IEnumerable<DependencyViewModel>)ViewData["dependencies"])
.Name("gantt")
.Columns(columns =>
{
columns.Bound(c => c.Studio).Title("Студія").Width(200).Sortable(true);
columns.Bound(c => c.ProjectGenre).Title("Жанр").Width(300).Sortable(true).TemplateId("column-template");
})
.Views(views =>
{
views.YearView(yearView => yearView.Selected(true));
})
.ShowWorkHours(false)
.ShowWorkDays(false)
.Editable(false)
.Height(600)
.TaskTemplateId("task-template")
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.TaskID);
m.ParentId(f => f.ParentID);
m.Field(f => f.Expanded).DefaultValue(true);
m.Field(f => f.Start).ToString();
m.Field(f => f.End).ToString();
})
)
.Tooltip(t =>
{
t.Visible(true);
t.TemplateId("tooltip-tamplate");
})
.DependenciesDataSource(d => d
.Model(m =>
{
m.Id(f => f.DependencyID);
m.PredecessorId(f => f.PredecessorID);
m.SuccessorId(f => f.SuccessorID);
})
)
)