Skip to content

Commit 57c962c

Browse files
committed
Sync with Kendo UI Professional
1 parent d3e4ddd commit 57c962c

File tree

11 files changed

+330
-65
lines changed

11 files changed

+330
-65
lines changed

docs-aspnet/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ baseurl: /aspnet-core
702702
cdnVersion: "2024.1.319"
703703

704704
## The themes CDN used
705-
themesCdnVersion: "7.2.1"
705+
themesCdnVersion: "8.0.0"
706706

707707
## The MVC Core version used
708708
mvcCoreVersion: "2024.1.319"
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
title: How to Update All Successor Tasks When Updating the Parent Task
3+
description: Learn how to update all the successor tasks when updating the parent task end time in the Telerik UI for {{ site.framework }} Gantt.
4+
type: how-to
5+
page_title: Update Dependencies When The Parent Task End is Changed - Telerik UI for {{ site.framework }} Gantt
6+
slug: gantt-update-successor-when-parent-end-changes
7+
tags: gantt, successor, dependencies, update
8+
res_type: kb
9+
---
10+
11+
## Environment
12+
13+
<table>
14+
<tr>
15+
<td>Product</td>
16+
<td>Progress® Telerik® UI for {{ site.framework }} Gantt</td>
17+
</tr>
18+
</table>
19+
20+
21+
## Description
22+
23+
In some scenarios the start of one task is dependent on the end of another task. In such a case, if the end of the initial task changes, the start of the dependent task should also change automatically.
24+
How can I achieve this?
25+
26+
## Solution
27+
28+
1. Handle the [`e.Events(e=>e.Save())`](https://docs.telerik.com/kendo-ui/api/javascript/ui/gantt/events/save) event of the Gantt component.
29+
1. Find the time gap between the previous and the new end time of the updated task.
30+
1. Filter the dependencies of the updated tasks and update the start and end time accordignly.
31+
32+
33+
```Razor
34+
@using Telerik.Scaffolders.Models.Gantt
35+
36+
<script>
37+
var data = [
38+
{
39+
id: 1,
40+
orderId: 0,
41+
parentId: null,
42+
title: "Task1",
43+
start: new Date("2014/6/17 9:00"),
44+
end: new Date("2014/6/17 10:00")
45+
},
46+
{
47+
id: 2,
48+
orderId: 1,
49+
parentId: null,
50+
title: "Task2",
51+
start: new Date("2014/6/17 9:40"),
52+
end: new Date("2014/6/17 11:00")
53+
},
54+
{
55+
id: 3,
56+
orderId: 2,
57+
parentId: null,
58+
title: "Task3",
59+
start: new Date("2014/6/17 11:00"),
60+
end: new Date("2014/6/17 12:30")
61+
},
62+
{
63+
id: 4,
64+
orderId: 3,
65+
parentId: null,
66+
title: "Task4",
67+
start: new Date("2014/6/17 9:00"),
68+
end: new Date("2014/6/17 11:00")
69+
},
70+
{
71+
id: 5,
72+
orderId: 4,
73+
parentId: null,
74+
title: "Task5",
75+
start: new Date("2014/6/17 11:00"),
76+
end: new Date("2014/6/17 12:00")
77+
},
78+
{
79+
id: 6,
80+
orderId: 5,
81+
parentId: null,
82+
title: "Task 6",
83+
start: new Date("2014/6/17 13:30"),
84+
end: new Date("2014/6/17 15:00")
85+
}
86+
];
87+
88+
var dependencies= [
89+
{
90+
id: 1,
91+
predecessorId: 1,
92+
successorId: 2,
93+
type: 1
94+
},
95+
{
96+
id: 2,
97+
predecessorId: 2,
98+
successorId: 3,
99+
type: 1
100+
},
101+
{
102+
id: 3,
103+
predecessorId: 4,
104+
successorId: 5,
105+
type: 1
106+
},
107+
{
108+
id: 4,
109+
predecessorId: 3,
110+
successorId: 6,
111+
type: 1
112+
},
113+
];
114+
115+
</script>
116+
117+
@(Html.Kendo().Gantt<TaskModel, DependencyModel>()
118+
.Name("gantt")
119+
.Height(400)
120+
.DataSource("data")
121+
.DependenciesDataSource("dependencies")
122+
.Events(e => e.Save("ganttSave"))
123+
)
124+
125+
<script>
126+
function ganttSave(e) {
127+
var task = e.task;
128+
129+
if (!e.values.end) {
130+
return;
131+
}
132+
133+
var startDelta = e.values.end - e.task.end;
134+
135+
moveTask(e.sender, task, startDelta)
136+
137+
e.sender.dependencies.filter(null);
138+
e.sender.dataSource.sync();
139+
}
140+
141+
function moveTask(gantt, task, startDelta) {
142+
143+
var t = gantt.dependencies.filter({
144+
field: "predecessorId",
145+
operator: "equals",
146+
value: task.id
147+
});
148+
149+
150+
$(gantt.dependencies.view()).each(function (index, dependency) {
151+
152+
var dependentTask = gantt.dataSource.get(dependency.successorId);
153+
var dependentTaskStart = dependentTask.get("start");
154+
var dependentTaskEnd = dependentTask.get("end");
155+
156+
dependentTask.set("start", new Date(dependentTaskStart.getTime() + startDelta));
157+
dependentTask.set("end", new Date(dependentTaskEnd.getTime() + startDelta));
158+
159+
gantt.dependencies.filter(null);
160+
161+
var nextTask = gantt.dataSource.get(dependentTask.id);
162+
163+
moveTask(gantt, nextTask, startDelta)
164+
165+
});
166+
}
167+
</script>
168+
169+
170+
```

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ baseurl: /kendo-ui
715715
cdnVersion: "2024.1.319"
716716

717717
## The themes CDN used
718-
themesCdnVersion: "7.2.1"
718+
themesCdnVersion: "8.0.0"
719719

720720
## The MVC Core version used
721721
mvcCoreVersion: "2024.1.319"

docs/api/javascript/ui/textbox.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ Represents the Kendo UI TextBox widget. Inherits from [Widget](/api/javascript/u
1212

1313
## Configuration
1414

15+
### clearButton `Boolean` *(default: false)*
16+
17+
If set to `true`, will render a button that can be used to clear the value.
18+
19+
#### Example - disable the widget
20+
21+
<input id="textbox" />
22+
<script>
23+
$("#textbox").kendoTextBox({
24+
value: "John",
25+
clearButton: true
26+
});
27+
</script>
28+
1529
### enable `Boolean` *(default: true)*
1630

1731
If set to `false`, the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

package-lock.json

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"license": "Apache-2.0",
1111
"version": "1.0.0",
1212
"devDependencies": {
13-
"@progress/kendo-svg-icons": "2.3.0",
14-
"@progress/kendo-theme-bootstrap": "8.0.0-dev.11",
15-
"@progress/kendo-theme-classic": "8.0.0-dev.11",
16-
"@progress/kendo-theme-core": "8.0.0-dev.11",
17-
"@progress/kendo-theme-default": "8.0.0-dev.11",
18-
"@progress/kendo-theme-fluent": "8.0.0-dev.11",
19-
"@progress/kendo-theme-material": "8.0.0-dev.11",
20-
"@progress/kendo-theme-utils": "8.0.0-dev.11",
13+
"@progress/kendo-svg-icons": "3.0.0",
14+
"@progress/kendo-theme-bootstrap": "8.0.0",
15+
"@progress/kendo-theme-classic": "8.0.0",
16+
"@progress/kendo-theme-core": "8.0.0",
17+
"@progress/kendo-theme-default": "8.0.0",
18+
"@progress/kendo-theme-fluent": "8.0.0",
19+
"@progress/kendo-theme-material": "8.0.0",
20+
"@progress/kendo-theme-utils": "8.0.0",
2121
"@progress/wct-a11y-spec": "^2.0.9",
2222
"@rollup/plugin-node-resolve": "^13.3.0",
2323
"@rollup/plugin-virtual": "^2.1.0",

0 commit comments

Comments
 (0)