Skip to content

Commit c9814ed

Browse files
Merge remote-tracking branch 'remotes/origin/development'
2 parents 141e646 + 5e8e1d7 commit c9814ed

File tree

29 files changed

+597
-11
lines changed

29 files changed

+597
-11
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = projectViewMultiTaskData();
4+
return View();
5+
}
6+
7+
public static List<GanttDataSource> projectViewMultiTaskData()
8+
{
9+
List<GanttDataSource> GanttDataSourceCollection = new List<GanttDataSource>();
10+
11+
GanttDataSource Record1 = new GanttDataSource()
12+
{
13+
TaskId = 1,
14+
TaskName = "Product Concept",
15+
StartDate = new DateTime(2019, 04, 02),
16+
EndDate = new DateTime(2019, 04, 21),
17+
isExpand = false,
18+
SubTasks = new List<GanttDataSource>(),
19+
};
20+
GanttDataSource Child1 = new GanttDataSource()
21+
{
22+
TaskId = 2,
23+
TaskName = "Defining the product and its usage",
24+
StartDate = new DateTime(2019, 04, 02),
25+
Duration = 3,
26+
Progress = 30
27+
28+
};
29+
GanttDataSource Child2 = new GanttDataSource()
30+
{
31+
TaskId = 3,
32+
TaskName = "Defining target audience",
33+
StartDate = new DateTime(2019, 04, 04),
34+
Duration = 3,
35+
36+
};
37+
GanttDataSource Child3 = new GanttDataSource()
38+
{
39+
TaskId = 4,
40+
TaskName = "Prepare product sketch and notes",
41+
StartDate = new DateTime(2019, 04, 10),
42+
Duration = 3,
43+
Progress = 30
44+
};
45+
Record1.SubTasks.Add(Child1);
46+
Record1.SubTasks.Add(Child2);
47+
Record1.SubTasks.Add(Child3);
48+
49+
GanttDataSource Record2 = new GanttDataSource()
50+
{
51+
TaskId = 5,
52+
TaskName = "Feedback and Testing",
53+
StartDate = new DateTime(2019, 04, 04),
54+
EndDate = new DateTime(2019, 04, 21),
55+
isExpand = true,
56+
SubTasks = new List<GanttDataSource>()
57+
};
58+
GanttDataSource Child4 = new GanttDataSource()
59+
{
60+
TaskId = 6,
61+
TaskName = "Internal testing and feedback",
62+
StartDate = new DateTime(2019, 04, 04),
63+
Duration = 5,
64+
Progress = 30
65+
};
66+
GanttDataSource Child5 = new GanttDataSource()
67+
{
68+
TaskId = 7,
69+
TaskName = "Customer testing and feedback",
70+
StartDate = new DateTime(2019, 04, 10),
71+
Duration = 7,
72+
Progress = 30
73+
};
74+
Record2.SubTasks.Add(Child4);
75+
Record2.SubTasks.Add(Child5);
76+
77+
GanttDataSource Record3 = new GanttDataSource()
78+
{
79+
TaskId = 8,
80+
TaskName = "Product Development",
81+
StartDate = new DateTime(2019, 04, 04),
82+
EndDate = new DateTime(2019, 04, 21),
83+
isExpand = false,
84+
SubTasks = new List<GanttDataSource>()
85+
};
86+
GanttDataSource Child6 = new GanttDataSource()
87+
{
88+
TaskId = 9,
89+
TaskName = "Important improvements",
90+
StartDate = new DateTime(2019, 04, 04),
91+
Duration = 2,
92+
Progress = 30
93+
};
94+
GanttDataSource Child7 = new GanttDataSource()
95+
{
96+
TaskId = 10,
97+
TaskName = "Address any unforeseen issues",
98+
StartDate = new DateTime(2019, 04, 06),
99+
Duration = 2,
100+
Progress = 30
101+
};
102+
Record2.SubTasks.Add(Child6);
103+
Record2.SubTasks.Add(Child7);
104+
105+
GanttDataSource Record4 = new GanttDataSource()
106+
{
107+
TaskId = 11,
108+
TaskName = "Final Product",
109+
StartDate = new DateTime(2019, 04, 04),
110+
EndDate = new DateTime(2019, 04, 21),
111+
isExpand = false,
112+
SubTasks = new List<GanttDataSource>()
113+
};
114+
GanttDataSource Child8 = new GanttDataSource()
115+
{
116+
TaskId = 12,
117+
TaskName = "Branding product",
118+
StartDate = new DateTime(2019, 04, 06),
119+
Duration = 5
120+
};
121+
GanttDataSource Child9 = new GanttDataSource()
122+
{
123+
TaskId = 13,
124+
TaskName = "Marketing and pre-sales",
125+
StartDate = new DateTime(2019, 04, 12),
126+
Duration = 10,
127+
Progress = 30
128+
};
129+
Record2.SubTasks.Add(Child8);
130+
Record2.SubTasks.Add(Child9);
131+
132+
GanttDataSourceCollection.Add(Record1);
133+
GanttDataSourceCollection.Add(Record2);
134+
GanttDataSourceCollection.Add(Record3);
135+
GanttDataSourceCollection.Add(Record4);
136+
137+
return GanttDataSourceCollection;
138+
}
139+
140+
public class GanttDataSource
141+
{
142+
public int TaskId { get; set; }
143+
public string TaskName { get; set; }
144+
public DateTime StartDate { get; set; }
145+
public DateTime EndDate { get; set; }
146+
public int? Duration { get; set; }
147+
public DateTime BaselineStartDate { get; set; }
148+
public DateTime BaselineEndDate { get; set; }
149+
public int Progress { get; set; }
150+
public bool isExpand { get; set; }
151+
public List<GanttDataSource> SubTasks { get; set; }
152+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).EnableMultiTaskbar(
2+
true).Height("450px").TaskFields(ts => ts.Id("TaskId").Name("TaskName").StartDate("StartDate").Duration("Duration").Progress("Progress").Child("SubTasks").ExpandState(
3+
"isExpand")).Render()
4+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ejs-gantt id='Gantt' dataSource="ViewBag.DataSource" enableMultiTaskbar="true" height="450px">
2+
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate" duration="Duration" child="SubTasks" progress="Progress"
3+
endDate="EndDate" expandState="isExpand">
4+
</e-gantt-taskfields>
5+
</ejs-gantt>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = GanttData.ProjectNewData();
4+
return View();
5+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
@Html.EJS().Button("ClearUndoCollection").Content("Clear Undo Collection").CssClass("e-primary").Render()
3+
4+
@Html.EJS().Button("ClearRedoCollection").Content("Clear Redo Collection").CssClass("e-primary").Render()
5+
6+
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").Toolbar(new List<string>()
7+
{ "Add", "Edit", "Update", "Delete", "Search", "ZoomIn", "ZoomOut", "ZoomToFit","Indent","Outdent",
8+
"PrevTimeSpan", "NextTimeSpan","Undo","Redo"}).EnableUndoRedo(true).UndoRedoActions(new List<string>() { "Sorting", "Add", "ColumnReorder", "ColumnResize", "ColumnState", "Delete", "Edit", "Filtering", "Indent", "Outdent", "NextTimeSpan", "PreviousTimeSpan", "RowDragAndDrop", "Search", "ZoomIn", "ZoomOut", "ZoomToFit" }).TaskFields(ts =>
9+
ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks")
10+
).EditSettings(es=>es.AllowEditing(true).AllowAdding(true).AllowDeleting(true).AllowRowDragAndDrop(true).ShowColumnMenu(true)).Render()
11+
12+
<script>
13+
document.getElementById('ClearUndoCollection').addEventListener('click', function (args) {
14+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
15+
ganttObj.clearUndoCollection();
16+
});
17+
document.getElementById('ClearRedoCollection').addEventListener('click', function (args) {
18+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
19+
ganttObj.clearRedoCollection();
20+
});
21+
</script>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<ejs-button id="ClearUndoCollection" content="Clear Undo Collection" cssClass="e-primary"></ejs-button>
2+
<ejs-button id="ClearRedoCollection" content="Clear Redo Collection" cssClass="e-primary"></ejs-button>
3+
4+
<ejs-gantt id='Gantt' dataSource="ViewBag.dataSource" height="450px" enableUndoRedo="true" toolbar="@(new List<string>() { "Add", "Edit", "Update", "Delete", "Search", "ZoomIn", "ZoomOut", "ZoomToFit","Indent","Outdent",
5+
"PrevTimeSpan", "NextTimeSpan","Undo","Redo" })" allowSorting="true" allowFiltering="true" showColumnMenu="true" allowResizing="true" allowReordering="true" allowRowDragAndDrop="true"
6+
undoRedoActions="@(new List<string>() { "Sorting","Add","ColumnReorder","ColumnResize","ColumnState","Delete","Edit","Filtering","Indent","Outdent","NextTimeSpan","PreviousTimeSpan","RowDragAndDrop","Search","ZoomIn", "ZoomOut", "ZoomToFit"})">
7+
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate"
8+
endDate="EndDate" duration="Duration" progress="Progress" child="SubTasks">
9+
</e-gantt-taskfields>
10+
<e-gantt-editsettings allowAdding="true" allowEditing="true" allowDeleting="true"></e-gantt-editsettings>
11+
</ejs-gantt>
12+
13+
<script>
14+
document.getElementById('ClearUndoCollection').addEventListener('click', function (args) {
15+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
16+
ganttObj.clearUndoCollection();
17+
});
18+
document.getElementById('ClearRedoCollection').addEventListener('click', function (args) {
19+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
20+
ganttObj.clearRedoCollection();
21+
});
22+
</script>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = GanttData.ProjectNewData();
4+
return View();
5+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@Html.EJS().Button("Undo").Content("Undo").CssClass("e-primary").Render()
2+
3+
@Html.EJS().Button("Redo").Content("Redo").CssClass("e-primary").Render()
4+
5+
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").Toolbar(new List<string>()
6+
{ "Add", "Edit", "Update", "Delete", "Search", "ZoomIn", "ZoomOut", "ZoomToFit","Indent","Outdent",
7+
"PrevTimeSpan", "NextTimeSpan","Undo","Redo"}).EnableUndoRedo(true).UndoRedoActions(new List<string>() { "Sorting", "Add", "ColumnReorder", "ColumnResize", "ColumnState", "Delete", "Edit", "Filtering", "Indent", "Outdent", "NextTimeSpan", "PreviousTimeSpan", "RowDragAndDrop", "Search", "ZoomIn", "ZoomOut", "ZoomToFit" }).TaskFields(ts =>
8+
ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks")
9+
).EditSettings(es=>es.AllowEditing(true).AllowAdding(true).AllowDeleting(true).AllowRowDragAndDrop(true).ShowColumnMenu(true)).Render()
10+
11+
<script>
12+
document.getElementById('Undo').addEventListener('click', function (args) {
13+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
14+
ganttObj.undo();
15+
});
16+
document.getElementById('Redo').addEventListener('click', function (args) {
17+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
18+
ganttObj.redo();
19+
});
20+
</script>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<ejs-button id="Undo" content="Undo" cssClass="e-primary"></ejs-button>
2+
<ejs-button id="Redo" content="Redo" cssClass="e-primary"></ejs-button>
3+
4+
<ejs-gantt id='Gantt' dataSource="ViewBag.dataSource" height="450px" enableUndoRedo="true" toolbar="@(new List<string>() { "Add", "Edit", "Update", "Delete", "Search", "ZoomIn", "ZoomOut", "ZoomToFit","Indent","Outdent",
5+
"PrevTimeSpan", "NextTimeSpan","Undo","Redo" })" allowSorting="true" allowFiltering="true" showColumnMenu="true" allowResizing="true" allowReordering="true" allowRowDragAndDrop="true"
6+
undoRedoActions="@(new List<string>() { "Sorting","Add","ColumnReorder","ColumnResize","ColumnState","Delete","Edit","Filtering","Indent","Outdent","NextTimeSpan","PreviousTimeSpan","RowDragAndDrop","Search","ZoomIn", "ZoomOut", "ZoomToFit"})">
7+
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate"
8+
endDate="EndDate" duration="Duration" progress="Progress" child="SubTasks">
9+
</e-gantt-taskfields>
10+
<e-gantt-editsettings allowAdding="true" allowEditing="true" allowDeleting="true"></e-gantt-editsettings>
11+
</ejs-gantt>
12+
13+
<script>
14+
document.getElementById('Undo').addEventListener('click', function (args) {
15+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
16+
ganttObj.undo();
17+
});
18+
document.getElementById('Redo').addEventListener('click', function (args) {
19+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
20+
ganttObj.redo();
21+
});
22+
</script>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
@Html.EJS().Button("GetUndoCollection").Content("Get Undo Collection").CssClass("e-primary").Render()
3+
4+
@Html.EJS().Button("GetRedoCollection").Content("Get Redo Collection").CssClass("e-primary").Render()
5+
6+
@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").Toolbar(new List<string>()
7+
{ "Add", "Edit", "Update", "Delete", "Search", "ZoomIn", "ZoomOut", "ZoomToFit","Indent","Outdent",
8+
"PrevTimeSpan", "NextTimeSpan","Undo","Redo"}).EnableUndoRedo(true).UndoRedoActions(new List<string>() { "Sorting", "Add", "ColumnReorder", "ColumnResize", "ColumnState", "Delete", "Edit", "Filtering", "Indent", "Outdent", "NextTimeSpan", "PreviousTimeSpan", "RowDragAndDrop", "Search", "ZoomIn", "ZoomOut", "ZoomToFit" }).TaskFields(ts =>
9+
ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks")
10+
).EditSettings(es=>es.AllowEditing(true).AllowAdding(true).AllowDeleting(true).AllowRowDragAndDrop(true).ShowColumnMenu(true)).Render()
11+
12+
<script>
13+
document.getElementById('GetUndoCollection').addEventListener('click', function (args) {
14+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
15+
console.log(ganttObj.getUndoActions());
16+
});
17+
document.getElementById('GetRedoCollection').addEventListener('click', function (args) {
18+
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
19+
console.log(ganttObj.getRedoActions());
20+
});
21+
</script>

0 commit comments

Comments
 (0)