Skip to content

Commit 516a4c0

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 800a0b5 commit 516a4c0

File tree

6 files changed

+118
-21
lines changed

6 files changed

+118
-21
lines changed

docs-aspnet/html-helpers/editors/flatcolorpicker/views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Views
3-
page_title: {{ site.product }} FlatColorPicker Documentation | FlatColorPicker Views
3+
page_title: The {{ site.product }} FlatColorPicker Documentation | FlatColorPicker Views
44
description: "Review the available views in the FlatColorPicker."
55
slug: htmlhelpers_views_flatcolorpickerhelper_aspnetcore
66
position: 2

docs/api/javascript/ui/treeview.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,45 @@ The expanded node
20112011
treeview.bind("expand", tree_expand);
20122012
</script>
20132013

2014+
### loadCompleted
2015+
2016+
This event triggers only when `loadOnDemand` is set to `false` - it indicates that all nodes that need to be loaded are ready and present as data items in the DataSource of the TreeView.
2017+
2018+
#### Event Data
2019+
2020+
##### e.nodes `Array`
2021+
2022+
All the nodes that have children and are loaded. If empty array is passed then no nodes have children to be loaded.
2023+
2024+
#### Example
2025+
2026+
<div id="treeview"></div>
2027+
<script>
2028+
var dataSource = new kendo.data.HierarchicalDataSource({
2029+
transport: {
2030+
read: {
2031+
url: "https://demos.telerik.com/kendo-ui/service/Employees",
2032+
dataType: "jsonp"
2033+
}
2034+
},
2035+
schema: {
2036+
model: {
2037+
id: "EmployeeId",
2038+
hasChildren: "HasEmployees"
2039+
}
2040+
}
2041+
});
2042+
2043+
$("#treeview").kendoTreeView({
2044+
loadOnDemand: false,
2045+
dataSource: dataSource,
2046+
dataTextField: "FullName",
2047+
loadCompleted: function (ev) {
2048+
console.log("Load Completed: ", ev.nodes);
2049+
}
2050+
});
2051+
</script>
2052+
20142053
### kendoKeydown
20152054

20162055
Triggered when the user presses a keyboard key while the TreeView is focused.

package-lock.json

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"version": "1.0.0",
1212
"dependencies": {},
1313
"devDependencies": {
14-
"@progress/kendo-theme-bootstrap": "5.2.0",
15-
"@progress/kendo-theme-classic": "5.2.0",
16-
"@progress/kendo-theme-default": "5.2.0",
17-
"@progress/kendo-theme-material": "5.2.0",
14+
"@progress/kendo-theme-bootstrap": "5.3.0",
15+
"@progress/kendo-theme-classic": "5.3.0",
16+
"@progress/kendo-theme-default": "5.3.0",
17+
"@progress/kendo-theme-material": "5.3.0",
1818
"autoprefixer": "^9.1.5",
1919
"axe-core": "^4.3.0",
2020
"bootstrap": "^4.0.0",

src/kendo.data.js

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ var __meta__ = { // jshint ignore:line
5555
REQUESTSTART = "requestStart",
5656
PROGRESS = "progress",
5757
REQUESTEND = "requestEnd",
58+
ITEMSLOADED = "itemsLoaded",
59+
ITEMLOAD = "itemLoad",
5860
crud = [CREATE, READ, UPDATE, DESTROY],
5961
identity = function(o) { return o; },
6062
getter = kendo.getter,
@@ -83,6 +85,8 @@ var __meta__ = { // jshint ignore:line
8385
that.length = array.length;
8486

8587
that.wrapAll(array, that);
88+
that._loadPromises = [];
89+
that._loadedNodes = [];
8690
},
8791

8892
at: function(index) {
@@ -148,11 +152,32 @@ var __meta__ = { // jshint ignore:line
148152
action: e.node || isGroup ? (e.action || "itemloaded") : "itemchange"
149153
});
150154
});
155+
156+
object.bind(ITEMLOAD, function (e) {
157+
that._loadPromises.push(e.promise);
158+
that._loading = true;
159+
160+
e.promise.done(function(){
161+
that._loadedNodes.push(e.node);
162+
var index = that._loadPromises.indexOf(e.promise);
163+
that._loadPromises.splice(index, 1);
164+
165+
if(!that._loadPromises.length){
166+
that._loading = false;
167+
that.trigger(ITEMSLOADED, {collection: that, nodes: that._loadedNodes});
168+
that._loadedNodes = [];
169+
}
170+
});
171+
});
151172
}
152173

153174
return object;
154175
},
155176

177+
loading: function () {
178+
return this._loading;
179+
},
180+
156181
push: function() {
157182
var index = this.length,
158183
items = this.wrapAll(arguments),
@@ -4100,7 +4125,7 @@ var __meta__ = { // jshint ignore:line
41004125
if (group.hasSubgroups) {
41014126
this._clearEmptyGroups(group.items);
41024127
}
4103-
4128+
41044129
if (group.items && !group.items.length) {
41054130
splice.apply(group.parent(), [idx, 1]);
41064131
}
@@ -5870,6 +5895,14 @@ var __meta__ = { // jshint ignore:line
58705895
}
58715896
});
58725897

5898+
children.bind(ITEMSLOADED, function (e) {
5899+
var collection = that.parent();
5900+
5901+
if (collection) {
5902+
collection.trigger(ITEMSLOADED, e);
5903+
}
5904+
});
5905+
58735906
that._updateChildrenField();
58745907
}
58755908
},
@@ -5930,6 +5963,9 @@ var __meta__ = { // jshint ignore:line
59305963
}
59315964

59325965
promise = children[method](options);
5966+
if (!this._loaded) {
5967+
this.trigger(ITEMLOAD, {promise: promise, node: this});
5968+
}
59335969
} else {
59345970
this.loaded(true);
59355971
}
@@ -5995,6 +6031,27 @@ var __meta__ = { // jshint ignore:line
59956031
that._data.bind(ERROR, function(e) {
59966032
that.trigger(ERROR, e);
59976033
});
6034+
6035+
that._data.bind(ITEMSLOADED, function(e) {
6036+
that.trigger(ITEMSLOADED, e);
6037+
});
6038+
},
6039+
6040+
loading: function () {
6041+
if(this._data) {
6042+
return this._data.loading() || this._childrenLoading();
6043+
}
6044+
return false;
6045+
},
6046+
6047+
_childrenLoading: function () {
6048+
var isLoading = false;
6049+
this._data.forEach(function (node) {
6050+
if(node.hasChildren && node.children.loading()) {
6051+
isLoading = true;
6052+
}
6053+
});
6054+
return isLoading;
59986055
},
59996056

60006057
read: function(data) {

typescript/kendo.all.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12311,6 +12311,7 @@ declare namespace kendo.ui {
1231112311
dataTextField?: string|any | undefined;
1231212312
dataUrlField?: string | undefined;
1231312313
dragAndDrop?: boolean | undefined;
12314+
loadCompleted?(e: TreeViewEvent): void;
1231412315
loadOnDemand?: boolean | undefined;
1231512316
messages?: TreeViewMessages | undefined;
1231612317
template?: string|Function | undefined;

0 commit comments

Comments
 (0)