Skip to content

Commit b86b476

Browse files
author
Mathanraj3786
committed
890529: timeline template
1 parent f8c331c commit b86b476

File tree

2 files changed

+35
-21
lines changed
  • ej2-asp-core-mvc/code-snippet/gantt/tooltip/timelineTemplate

2 files changed

+35
-21
lines changed

ej2-asp-core-mvc/code-snippet/gantt/tooltip/timelineTemplate/razor

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").TaskFields(ts => ts.Id("TaskId").Name(
2-
"TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks")).TimelineTemplate("#timelineTemplates") .TimelineSettings(ts => ts.TimelineUnitSize(100).TopTier(tt => tt.Unit(Syncfusion.EJ2.Gantt.TimelineViewMode.Week).Format("MMM dd, yyyy"))
3-
.BottomTier(bt => bt.Unit(Syncfusion.EJ2.Gantt.TimelineViewMode.Day).Count(1))).Holidays(hol => {
4-
hol.From("04/04/2019").To("04/05/2019").Label("Local Holiday").Add();
5-
hol.From("04/12/2019").To("04/12/2019").Label("Public holiday").Add();
6-
}) .LabelSettings(ls => ls.LeftLabel("TaskName")).Render()
7-
1+
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable < object >)ViewBag.DataSource).Height("450px").AllowSelection(true).TreeColumnIndex(1)
2+
.TaskFields(ts => ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress")
3+
.Dependency("Predecessor").Child("SubTasks")).TimelineTemplate("#timelineTemplates").TimelineSettings(ts => ts.TimelineUnitSize(100).TopTier(tt => tt.Unit(Syncfusion.EJ2.Gantt.TimelineViewMode.Week).Format("MMM dd, yyyy"))
4+
.BottomTier(bt => bt.Unit(Syncfusion.EJ2.Gantt.TimelineViewMode.Day).Count(1)))
5+
{
6+
col.Field("TaskId").Visible(false).Add();
7+
col.Field("TaskName").Width(300).Add();
8+
col.Field("StartDate").Add();
9+
col.Field("EndDate").Add();
10+
col.Field("Duration").Add();
11+
col.Field("Progress").Add();
12+
})
13+
.LabelSettings(ls => ls.LeftLabel("TaskName"))
14+
.SplitterSettings(sp => sp.ColumnIndex(1))
15+
.ProjectStartDate("03/31/2024")
16+
.ProjectEndDate("04/23/2024")
17+
.Holidays(hol => {
18+
hol.From("04/04/2019").To("04/05/2019").Label("Local Holiday").Add();
19+
hol.From("04/12/2019").To("04/12/2019").Label("Public holiday").Add();
20+
})
21+
.Render()
822
<script type="text/x-jsrender" id="TimelineTemplates">
923
${if(tier == 'topTier')}
1024
<div class="e-header-cell-label e-gantt-top-cell-text" style="width:100%;background-color: #FBF9F1 ; font-weight: bold;height: 100%;display: flex; justify-content: center ; align-items: center; "title=${date}>

ej2-asp-core-mvc/code-snippet/gantt/tooltip/timelineTemplate/tagHelper

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
<ejs-gantt id='Gantt' dataSource="ViewBag.DataSource" height="450px" timelineTemplate = "#TimelineTemplates">
2-
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate" endDate="EndDate" duration="Duration" progress="Progress" child="SubTasks">
1+
<ejs-gantt id='Gantt' dataSource="ViewBag.dataSource" height="450px" allowSelection="true" treeColumnIndex="1"
2+
projectStartDate="03/31/2024" projectEndDate="04/23/2024" timelineTemplate="#timelineTemplates">
3+
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate" endDate="EndDate" duration="Duration"
4+
progress="Progress" dependency="Predecessor" child="SubTasks">
35
</e-gantt-taskfields>
4-
<e-gantt-splitterSettings columnIndex="1"></e-gantt-splitterSettings>
5-
<e-gantt-columns>
6-
<e-gantt-column field="TaskId" visible = false></e-gantt-column>
7-
<e-gantt-column field="TaskName" headerText="Name" width="250"></e-gantt-column>
6+
<e-gantt-columns>
7+
<e-gantt-column field="TaskId" visible=false></e-gantt-column>
8+
<e-gantt-column field="TaskName" width="300"></e-gantt-column>
89
<e-gantt-column field="StartDate"></e-gantt-column>
10+
<e-gantt-column field="EndDate"></e-gantt-column>
911
<e-gantt-column field="Duration"></e-gantt-column>
1012
<e-gantt-column field="Progress"></e-gantt-column>
11-
<e-gantt-column field="Predecessor"></e-gantt-column>
1213
</e-gantt-columns>
13-
<e-gantt-holidays>
14-
<e-gantt-holiday from="04/04/2019" to="04/04/2019" label="Local Holiday"></e-gantt-holiday>
15-
<e-gantt-holiday from="04/19/2019" to="04/19/2019" label="Good Friday"></e-gantt-holiday>
16-
<e-gantt-holiday from="04/30/2019" to="04/30/2019" label="Release Holiday"></e-gantt-holiday>
17-
</e-gantt-holidays>
18-
<e-gantt-labelSettings leftLabel="TaskName"></e-gantt-labelSettings>
1914
<e-gantt-timelinesettings timelineUnitSize="100">
2015
<e-timelinesettings-toptier unit="Week" format="MMM dd, y"></e-timelinesettings-toptier>
2116
<e-timelinesettings-bottomtier unit="Day"></e-timelinesettings-bottomtier>
2217
</e-gantt-timelinesettings>
23-
18+
<e-gantt-labelSettings leftLabel="TaskName"></e-gantt-labelSettings>
19+
<e-gantt-splittersettings columnIndex="1"></e-gantt-splittersettings>
20+
<e-gantt-holidays>
21+
<e-gantt-holiday from="04/04/2019" to="04/04/2019" label="Local Holiday"></e-gantt-holiday>
22+
<e-gantt-holiday from="04/19/2019" to="04/19/2019" label="Public holiday"></e-gantt-holiday>
23+
</e-gantt-holidays>
2424
</ejs-gantt>
2525
<script type="text/x-jsrender" id="TimelineTemplates">
2626
${if(tier == 'topTier')}

0 commit comments

Comments
 (0)