Skip to content

Commit 6db5b5d

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 88ad05e commit 6db5b5d

File tree

8 files changed

+1418
-1315
lines changed

8 files changed

+1418
-1315
lines changed

docs/uiforreact_introduction.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/kendo.data.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,15 @@ var __meta__ = { // jshint ignore:line
400400
}
401401

402402
var LazyObservableArray = ObservableArray.extend({
403-
init: function(data, type) {
403+
init: function (data, type, events) {
404404
Observable.fn.init.call(this);
405405

406406
this.type = type || ObservableObject;
407407

408+
if (events) {
409+
this._events = events;
410+
}
411+
408412
for (var idx = 0; idx < data.length; idx++) {
409413
this[idx] = data[idx];
410414
}
@@ -2208,7 +2212,7 @@ var __meta__ = { // jshint ignore:line
22082212
if (group.hasSubgroups) {
22092213
wrapGroupItems(group.items, model);
22102214
} else {
2211-
group.items = new LazyObservableArray(group.items, model);
2215+
group.items = new LazyObservableArray(group.items, model, group.items._events);
22122216
}
22132217
}
22142218
}

src/kendo.notification.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ var __meta__ = { // jshint ignore:line
311311
var that = this,
312312
autoHideAfter = options.autoHideAfter,
313313
animation = options.animation,
314-
insertionMethod = options.stacking == UP || options.stacking == LEFT ? "prependTo" : "appendTo";
314+
insertionMethod = options.stacking == UP || options.stacking == LEFT ? "prependTo" : "appendTo",
315+
initializedNotifications;
315316

316317
wrapper
317318
.removeClass("k-popup")
@@ -320,13 +321,16 @@ var __meta__ = { // jshint ignore:line
320321
.hide()
321322
.kendoAnimate(animation.open || false);
322323

323-
that._attachStaticEvents(options, wrapper);
324+
initializedNotifications = that.getNotifications();
325+
initializedNotifications.each(function(idx, element) {
326+
that._attachStaticEvents(options, $(element));
324327

325-
if (autoHideAfter > 0) {
326-
setTimeout(function(){
327-
that._hideStatic(wrapper);
328-
}, autoHideAfter);
329-
}
328+
if (autoHideAfter > 0) {
329+
setTimeout(function(){
330+
that._hideStatic($(element));
331+
}, autoHideAfter);
332+
}
333+
});
330334
},
331335

332336
_hideStatic: function(wrapper) {

tests/data/datasource/observable-array.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,104 @@ test("parents chain is correct when grouping on multiple fields", function() {
134134
equal(groupItem.parent().parent(), viewModel);
135135
equal(nestedGroupItem.parent().parent().parent().parent(), viewModel);
136136
});
137+
138+
test("change event should trigger when editing an item with server grouping", function () {
139+
var onChange = function (e) {
140+
if (e.action === 'itemchange') {
141+
ok(true);
142+
}
143+
};
144+
145+
var response = [
146+
{
147+
"Aggregates": {
148+
149+
},
150+
"HasSubgroups": false,
151+
"Member": "Salary",
152+
"Subgroups": [
153+
154+
],
155+
"items": [
156+
{
157+
"Id": 1,
158+
"Name": "John Smith",
159+
"Salary": 2000
160+
}
161+
],
162+
"Aggregates": {
163+
"Salary": {
164+
"sum": 2000
165+
}
166+
},
167+
"Key": 2000
168+
},
169+
{
170+
"Key": 3000,
171+
"HasSubgroups": false,
172+
"Member": "Salary",
173+
"items": [
174+
{
175+
"Id": 2,
176+
"Name": "Jane Rottencrotch",
177+
"Salary": 3000
178+
}
179+
],
180+
"Aggregates": {
181+
182+
},
183+
"Subgroups": [
184+
185+
]
186+
}
187+
];
188+
189+
var dataSource = new kendo.data.DataSource({
190+
"change": onChange,
191+
"transport": {
192+
"read": 'someurl'
193+
},
194+
"serverPaging": true,
195+
"serverSorting": true,
196+
"serverFiltering": true,
197+
"serverGrouping": true,
198+
"serverAggregates": true,
199+
"group": [
200+
{
201+
"field": "Salary",
202+
"dir": "asc"
203+
}
204+
],
205+
"filter": [
206+
207+
],
208+
"aggregate": [{
209+
"field": "Salary",
210+
"aggregate": "sum"
211+
}],
212+
"schema": {
213+
"data": "Data",
214+
"total": "Total",
215+
"errors": "Errors",
216+
"model": {
217+
"id": "Id",
218+
"fields": {
219+
"Id": {
220+
"type": "number"
221+
},
222+
"Name": {
223+
"type": "string"
224+
},
225+
"Salary": {
226+
"type": "number"
227+
},
228+
}
229+
}
230+
}
231+
});
232+
233+
dataSource.success(response);
234+
dataSource.data()[0].items[0].set('Name', 'test');
235+
236+
});
137237
}());

0 commit comments

Comments
 (0)