Skip to content

Commit d6fd425

Browse files
Merge branch 'development' into EJ2-889454-dev
2 parents 6a60463 + 1441bad commit d6fd425

28 files changed

+591
-34
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).QueryTaskbarInfo("queryTaskbarInfo").Height("450px").
2+
TaskFields(ts => ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").
3+
Child("SubTasks").ResourceInfo("Resources")).ResourceFields(rf => rf.Id("ResourceId").Name("ResourceName")).
4+
Resources((IEnumerable<object>)ViewBag.projectResources).Columns(col =>
5+
{
6+
col.Field("TaskName").HeaderText("Task Name").Width(250).Add();
7+
col.Field("Resources").HeaderText("Resources").Width(175).Template("#resColumnTemplate").Add();
8+
col.Field("StartDate").Add();
9+
col.Field("Duration").Add();
10+
col.Field("Progress").Add();
11+
}).SplitterSettings(sp => sp.ColumnIndex(2)).Render()
12+
13+
<script>
14+
function queryTaskbarInfo(args) {
15+
if(args.data.Resources === 'Martin Tamer'){
16+
args.taskbarBgColor = '#DFECFF';
17+
args.progressBarBgColor = '#006AA6'
18+
}else if(args.data.Resources === 'Rose Fuller'){
19+
args.taskbarBgColor = '#E4E4E7';
20+
args.progressBarBgColor = '#766B7C'
21+
}
22+
else if(args.data.Resources === 'Margaret Buchanan'){
23+
args.taskbarBgColor = '#DFFFE2';
24+
args.progressBarBgColor = '#00A653'
25+
}
26+
else if(args.data.Resources === 'Tamer Vinet'){
27+
args.taskbarBgColor = '#FFEBE9';
28+
args.progressBarBgColor = '#FF3740'
29+
}
30+
}
31+
</script>
32+
33+
<script type="text/x-template" id="resColumnTemplate">
34+
${if(ganttProperties.resourceNames)}
35+
${if(ganttProperties.resourceNames === 'Martin Tamer')}
36+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 110px; height: 24px; border-radius: 24px; background: #DFECFF">
37+
<span style="color: #006AA6; font-weight: 500;">${ganttProperties.resourceNames}</span>
38+
</div>
39+
${/if}
40+
41+
${if(ganttProperties.resourceNames === 'Rose Fuller')}
42+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 110px; height: 24px; border-radius: 24px; background: #E4E4E7">
43+
<span style="color: #766B7C; font-weight: 500;">${ganttProperties.resourceNames}</span>
44+
</div>
45+
${/if}
46+
47+
${if(ganttProperties.resourceNames === 'Margaret Buchanan')}
48+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 160px; height: 24px; border-radius: 24px; background: #DFFFE2">
49+
<span style="color: #00A653; font-weight: 500;">${ganttProperties.resourceNames}</span>
50+
</div>
51+
${/if}
52+
53+
${if(ganttProperties.resourceNames === 'Tamer Vinet')}
54+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 110px; height: 24px; border-radius: 24px; background: #FFEBE9">
55+
<span style="color: #FF3740; font-weight: 500;">${ganttProperties.resourceNames}</span>
56+
</div>
57+
${/if}
58+
${/if}
59+
</script>
60+
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = ganttData();
4+
ViewBag.projectResources = projectResources();
5+
return View();
6+
}
7+
8+
public static List<GanttResources> projectResources()
9+
{
10+
List<GanttResources> GanttResourcesCollection = new List<GanttResources>();
11+
12+
GanttResources Record1 = new GanttResources()
13+
{
14+
ResourceId = 1,
15+
ResourceName = "Martin Tamer"
16+
};
17+
GanttResources Record2 = new GanttResources()
18+
{
19+
ResourceId = 2,
20+
ResourceName = "Rose Fuller"
21+
};
22+
GanttResources Record3 = new GanttResources()
23+
{
24+
ResourceId = 3,
25+
ResourceName = "Margaret Buchanan"
26+
};
27+
GanttResources Record4 = new GanttResources()
28+
{
29+
ResourceId = 4,
30+
ResourceName = "Tamer Vinet"
31+
};
32+
GanttResourcesCollection.Add(Record1);
33+
GanttResourcesCollection.Add(Record2);
34+
GanttResourcesCollection.Add(Record3);
35+
GanttResourcesCollection.Add(Record4);
36+
return GanttResourcesCollection;
37+
}
38+
public static List<GanttDataSource> ganttData()
39+
{
40+
List<GanttDataSource> GanttDataSourceCollection = new List<GanttDataSource>();
41+
42+
GanttDataSource Record1 = new GanttDataSource()
43+
{
44+
TaskId = 1,
45+
TaskName = "Project initiation",
46+
StartDate = new DateTime(2019, 04, 02),
47+
EndDate = new DateTime(2019, 04, 21),
48+
SubTasks = new List<GanttDataSource>(),
49+
};
50+
GanttDataSource Child1 = new GanttDataSource()
51+
{
52+
TaskId = 2,
53+
TaskName = "Identify site location",
54+
StartDate = new DateTime(2019, 04, 02),
55+
Duration = 4,
56+
Progress = 30,
57+
Resources = new List<ResourceModel>
58+
{
59+
new ResourceModel{ ResourceId = 1 }
60+
}
61+
};
62+
GanttDataSource Child2 = new GanttDataSource()
63+
{
64+
TaskId = 3,
65+
TaskName = "Perform soil test",
66+
StartDate = new DateTime(2019, 04, 02),
67+
Duration = 4,
68+
Resources = new List<ResourceModel>
69+
{
70+
new ResourceModel{ ResourceId = 2 }
71+
}
72+
};
73+
GanttDataSource Child3 = new GanttDataSource()
74+
{
75+
TaskId = 4,
76+
TaskName = "Soil test approval",
77+
StartDate = new DateTime(2019, 04, 02),
78+
Duration = 4,
79+
Progress = 30,
80+
Resources = new List<ResourceModel>
81+
{
82+
new ResourceModel{ ResourceId = 3 }
83+
}
84+
};
85+
Record1.SubTasks.Add(Child1);
86+
Record1.SubTasks.Add(Child2);
87+
Record1.SubTasks.Add(Child3);
88+
89+
GanttDataSource Record2 = new GanttDataSource()
90+
{
91+
TaskId = 5,
92+
TaskName = "Project estimation",
93+
StartDate = new DateTime(2019, 04, 02),
94+
EndDate = new DateTime(2019, 04, 21),
95+
SubTasks = new List<GanttDataSource>(),
96+
};
97+
GanttDataSource Child4 = new GanttDataSource()
98+
{
99+
TaskId = 6,
100+
TaskName = "Develop floor plan for estimation",
101+
StartDate = new DateTime(2019, 04, 04),
102+
Duration = 4,
103+
Progress = 30,
104+
Resources = new List<ResourceModel>
105+
{
106+
new ResourceModel{ ResourceId = 4 }
107+
}
108+
};
109+
GanttDataSource Child5 = new GanttDataSource()
110+
{
111+
TaskId = 7,
112+
TaskName = "List materials",
113+
StartDate = new DateTime(2019, 04, 04),
114+
Duration = 3,
115+
Resources = new List<ResourceModel>
116+
{
117+
new ResourceModel{ ResourceId = 1 }
118+
}
119+
};
120+
GanttDataSource Child6 = new GanttDataSource()
121+
{
122+
TaskId = 8,
123+
TaskName = "Estimation approval",
124+
StartDate = new DateTime(2019, 04, 01),
125+
Duration = 4,
126+
Progress = 30,
127+
Resources = new List<ResourceModel>
128+
{
129+
new ResourceModel{ ResourceId = 2}
130+
}
131+
};
132+
Record2.SubTasks.Add(Child4);
133+
Record2.SubTasks.Add(Child5);
134+
Record2.SubTasks.Add(Child6);
135+
136+
GanttDataSourceCollection.Add(Record1);
137+
GanttDataSourceCollection.Add(Record2);
138+
139+
return GanttDataSourceCollection;
140+
}
141+
public class ResourceModel
142+
{
143+
public int ResourceId { get; set; }
144+
public Nullable<int> ResourceUnit { get; set; }
145+
}
146+
public class GanttResources
147+
{
148+
public int ResourceId { get; set; }
149+
public string ResourceName { get; set; }
150+
}
151+
public class GanttDataSource
152+
{
153+
public int TaskId { get; set; }
154+
public string TaskName { get; set; }
155+
public DateTime StartDate { get; set; }
156+
public DateTime EndDate { get; set; }
157+
public int? Duration { get; set; }
158+
public int Progress { get; set; }
159+
public List<GanttDataSource> SubTasks { get; set; }
160+
public List<ResourceModel> Resources { get; set; }
161+
162+
}
163+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<ejs-gantt id='resAllocation' dataSource="ViewBag.dataSource" resources="ViewBag.projectResources" highlightWeekends="true"
2+
height="450px" queryTaskbarInfo="queryTaskbarInfo">
3+
<e-gantt-columns>
4+
<e-gantt-column field="TaskName" headerText="Task Name" width="270"></e-gantt-column>
5+
<e-gantt-column field="Resources" width="175" template="#resColumnTemplate"></e-gantt-column>
6+
<e-gantt-column field="StartDate"></e-gantt-column>
7+
<e-gantt-column field="Duration"></e-gantt-column>
8+
</e-gantt-columns>
9+
<e-gantt-labelSettings rightLabel="Resources"></e-gantt-labelSettings>
10+
<e-gantt-splitterSettings columnIndex="2"></e-gantt-splitterSettings>
11+
12+
<e-gantt-resourcefields id="ResourceId" name="ResourceName">
13+
</e-gantt-resourcefields>
14+
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate"
15+
endDate="EndDate" duration="Duration" progress="Progress"
16+
child="SubTasks" resourceInfo="Resources">
17+
</e-gantt-taskfields>
18+
</ejs-gantt>
19+
<script>
20+
function queryTaskbarInfo(args) {
21+
if(args.data.Resources === 'Martin Tamer'){
22+
args.taskbarBgColor = '#DFECFF';
23+
args.progressBarBgColor = '#006AA6'
24+
}else if(args.data.Resources === 'Rose Fuller'){
25+
args.taskbarBgColor = '#E4E4E7';
26+
args.progressBarBgColor = '#766B7C'
27+
}
28+
else if(args.data.Resources === 'Margaret Buchanan'){
29+
args.taskbarBgColor = '#DFFFE2';
30+
args.progressBarBgColor = '#00A653'
31+
}
32+
else if(args.data.Resources === 'Tamer Vinet'){
33+
args.taskbarBgColor = '#FFEBE9';
34+
args.progressBarBgColor = '#FF3740'
35+
}
36+
}
37+
</script>
38+
39+
<script type="text/x-template" id="resColumnTemplate">
40+
${if(ganttProperties.resourceNames)}
41+
${if(ganttProperties.resourceNames === 'Martin Tamer')}
42+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 110px; height: 24px; border-radius: 24px; background: #DFECFF">
43+
<span style="color: #006AA6; font-weight: 500;">${ganttProperties.resourceNames}</span>
44+
</div>
45+
${/if}
46+
47+
${if(ganttProperties.resourceNames === 'Rose Fuller')}
48+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 110px; height: 24px; border-radius: 24px; background: #E4E4E7">
49+
<span style="color: #766B7C; font-weight: 500;">${ganttProperties.resourceNames}</span>
50+
</div>
51+
${/if}
52+
53+
${if(ganttProperties.resourceNames === 'Margaret Buchanan')}
54+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 160px; height: 24px; border-radius: 24px; background: #DFFFE2">
55+
<span style="color: #00A653; font-weight: 500;">${ganttProperties.resourceNames}</span>
56+
</div>
57+
${/if}
58+
59+
${if(ganttProperties.resourceNames === 'Tamer Vinet')}
60+
<div style="display: flex; align-items: center; justify-content: center; gap: 10px; width: 110px; height: 24px; border-radius: 24px; background: #FFEBE9">
61+
<span style="color: #FF3740; font-weight: 500;">${ganttProperties.resourceNames}</span>
62+
</div>
63+
${/if}
64+
${/if}
65+
</script>

ej2-asp-core-mvc/common/EJ2_ASP.MVC/accessibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ letter-spacing: 0.7px;
134134
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/tree-grid/accessibility">Tree Grid</a></div>
135135
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/spreadsheet/accessibility">Spreadsheet</a></div>
136136
<div><p class="controlcategory">FILE VIEWERS & EDITORS</p></div>
137-
<div class="controlanchorlink"><a target="_self" href="">In-place Editor</a></div>
137+
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/in-place-editor/accessibility">In-place Editor</a></div>
138138
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/accessibility">PDF Viewer</a></div>
139139
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/rich-text-editor/accessibility">RichTextEditor</a></div>
140140
<div class="controlanchorlink"><a target="_self" href="">Word Processor</a></div>
@@ -154,7 +154,7 @@ letter-spacing: 0.7px;
154154
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/stock-chart/accessibility">Stock Chart</a></div>
155155
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/circular-gauge/accessibility">Circular Gauge</a></div>
156156
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/diagram/accessibility">Diagram</a></div>
157-
<div class="controlanchorlink"><a target="_self" href="">HeatMap Chart</a></div>
157+
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/heatmap-chart/accessibility">HeatMap Chart</a></div>
158158
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/linear-gauge/accessibility">Linear Gauge</a></div>
159159
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/maps/accessibility">Maps</a></div>
160160
<div class="controlanchorlink"><a target="_self" href="https://ej2.syncfusion.com/aspnetmvc/documentation/range-navigator/accessibility">Range Selector</a></div>

0 commit comments

Comments
 (0)