Skip to content

Commit 6c65309

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent e797d3f commit 6c65309

File tree

11 files changed

+687
-642
lines changed

11 files changed

+687
-642
lines changed

docs/api/javascript/data/datasource.md

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -257,32 +257,49 @@ The filters which are applied over the data items. By default, no filter is appl
257257
258258
#### Example - set a single filter
259259

260+
<h3>All names(no filters)</h3>
261+
<div id="non-filtered"></div>
262+
<h3>All names that start with "Ja"</h3>
263+
<div id="filtered"></div>
264+
260265
<script>
266+
var data = [
267+
{ name: "Jane Doe" },
268+
{ name: "John Doe" },
269+
{ name: "Jane Sam" },
270+
{ name: "John Doe" },
271+
{ name: "Jane Mike" }
272+
];
261273
var dataSource = new kendo.data.DataSource({
262-
data: [
263-
{ name: "Jane Doe" },
264-
{ name: "John Doe" }
265-
],
266-
filter: { field: "name", operator: "startswith", value: "Jane" }
274+
data: data,
275+
filter: { field: "name", operator: "startswith", value: "Ja" }
267276
});
268277
dataSource.fetch(function(){
269278
var view = dataSource.view();
270-
/* The result can be observed in the DevTools(F12) console of the browser. */
271-
console.log(view.length); // displays "1"
272-
/* The result can be observed in the DevTools(F12) console of the browser. */
273-
console.log(view[0].name); // displays "Jane Doe"
279+
view.forEach(function(item) {
280+
$("#filtered").append("name - " + item.name + "<br>");
281+
});
282+
});
283+
284+
data.forEach(function(item) {
285+
$("#non-filtered").append("name - " + item.name + "<br>");
274286
});
275287
</script>
276288

277289
#### Example - set the filter as a conjunction (and)
278290

291+
<h3>All products(no filters)</h3>
292+
<div id="non-filtered"></div>
293+
<h3>All products with category "Beverages" that are not "Coffee".</h3>
294+
<div id="filtered"></div>
295+
279296
<script>
280-
var dataSource = new kendo.data.DataSource({
281-
data: [
282-
{ name: "Tea", category: "Beverages" },
297+
var data = [{ name: "Tea", category: "Beverages" },
283298
{ name: "Coffee", category: "Beverages" },
284-
{ name: "Ham", category: "Food" }
285-
],
299+
{ name: "Ham", category: "Food" }];
300+
301+
var dataSource = new kendo.data.DataSource({
302+
data: data,
286303
filter: [
287304
// leave data items which are "Beverage" and not "Coffee"
288305
{ field: "category", operator: "eq", value: "Beverages" },
@@ -291,22 +308,32 @@ The filters which are applied over the data items. By default, no filter is appl
291308
});
292309
dataSource.fetch(function(){
293310
var view = dataSource.view();
294-
/* The result can be observed in the DevTools(F12) console of the browser. */
295-
console.log(view.length); // displays "1"
296-
/* The result can be observed in the DevTools(F12) console of the browser. */
297-
console.log(view[0].name); // displays "Tea"
311+
view.forEach(function(item) {
312+
$("#filtered").append("name - " + item.name + ", category - " + item.category + "<br>");
313+
});
314+
});
315+
316+
data.forEach(function(item) {
317+
$("#non-filtered").append("name - " + item.name + ", category - " + item.category + "<br>");
298318
});
299319
</script>
300320

301321
#### Example - set the filter as a disjunction (or)
302322

323+
<h3>All products(no filters)</h3>
324+
<div id="non-filtered"></div>
325+
<h3>All products with category "Food" or name "Tea".</h3>
326+
<div id="filtered"></div>
327+
303328
<script>
304-
var dataSource = new kendo.data.DataSource({
305-
data: [
329+
var data = [
306330
{ name: "Tea", category: "Beverages" },
307331
{ name: "Coffee", category: "Beverages" },
308332
{ name: "Ham", category: "Food" }
309-
],
333+
];
334+
335+
var dataSource = new kendo.data.DataSource({
336+
data: data,
310337
filter: {
311338
// leave data items which are "Food" or "Tea"
312339
logic: "or",
@@ -318,12 +345,13 @@ The filters which are applied over the data items. By default, no filter is appl
318345
});
319346
dataSource.fetch(function(){
320347
var view = dataSource.view();
321-
/* The result can be observed in the DevTools(F12) console of the browser. */
322-
console.log(view.length); // displays "2"
323-
/* The result can be observed in the DevTools(F12) console of the browser. */
324-
console.log(view[0].name); // displays "Tea"
325-
/* The result can be observed in the DevTools(F12) console of the browser. */
326-
console.log(view[1].name); // displays "Ham"
348+
view.forEach(function(item) {
349+
$("#filtered").append("name - " + item.name + ", category - " + item.category + "<br>");
350+
});
351+
});
352+
353+
data.forEach(function(item) {
354+
$("#non-filtered").append("name - " + item.name + ", category - " + item.category + "<br>");
327355
});
328356
</script>
329357

docs/api/javascript/ui/grid.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ Custom commands are supported by specifying the [click](columns.command.click) o
287287
],
288288
editable: true,
289289
dataSource: {
290-
data: [ { name: "Jane Doe" } ],
290+
data: [ {Id: 1, name: "Jane Doe" } ],
291291
schema: {
292292
model: {
293+
id: "Id",
293294
fields: {
294295
name: { type: "string" }
295296
}
@@ -310,9 +311,10 @@ Custom commands are supported by specifying the [click](columns.command.click) o
310311
],
311312
editable: "inline",
312313
dataSource: {
313-
data: [ { name: "Jane Doe" } ],
314+
data: [ {Id: 1, name: "Jane Doe" } ],
314315
schema: {
315316
model: {
317+
id: "Id",
316318
fields: {
317319
name: { type: "string" }
318320
}
@@ -342,9 +344,10 @@ Custom commands are supported by specifying the [click](columns.command.click) o
342344
],
343345
editable: true,
344346
dataSource: {
345-
data: [ { name: "Jane Doe" } ],
347+
data: [ {Id: 1, name: "Jane Doe" } ],
346348
schema: {
347349
model: {
350+
id: "Id",
348351
fields: {
349352
name: { type: "string" }
350353
}
@@ -369,9 +372,10 @@ The CSS class applied to the command button.
369372
],
370373
editable: true,
371374
dataSource: {
372-
data: [ { name: "Jane Doe" } ],
375+
data: [ {Id: 1, name: "Jane Doe" } ],
373376
schema: {
374377
model: {
378+
id: "Id",
375379
fields: {
376380
name: { type: "string" }
377381
}
@@ -417,9 +421,10 @@ The function context (available via the `this` keyword) will be set to the grid
417421
}
418422
],
419423
dataSource: {
420-
data: [ { name: "Jane Doe" } ],
424+
data: [ {Id: 1, name: "Jane Doe" } ],
421425
schema: {
422426
model: {
427+
id: "Id",
423428
fields: {
424429
name: { type: "string" }
425430
}
@@ -451,9 +456,10 @@ When it is defined as an object it allows to customize the web font icon for the
451456
}
452457
],
453458
dataSource: {
454-
data: [ { name: "Jane Doe" } ],
459+
data: [ {Id: 1, name: "Jane Doe" } ],
455460
schema: {
456461
model: {
462+
id: "Id",
457463
fields: {
458464
name: { type: "string" }
459465
}
@@ -481,9 +487,10 @@ When it is defined as an object it allows to customize the web font icon for the
481487
}
482488
],
483489
dataSource: {
484-
data: [ { name: "Jane Doe" } ],
490+
data: [ {Id: 1, name: "Jane Doe" } ],
485491
schema: {
486492
model: {
493+
id: "Id",
487494
fields: {
488495
name: { type: "string" }
489496
}
@@ -514,9 +521,10 @@ The class for the [web font icon](https://docs.telerik.com/kendo-ui/styles-and-l
514521
}
515522
],
516523
dataSource: {
517-
data: [ { name: "Jane Doe" } ],
524+
data: [ {Id: 1, name: "Jane Doe" } ],
518525
schema: {
519526
model: {
527+
id: "Id",
520528
fields: {
521529
name: { type: "string" }
522530
}
@@ -547,9 +555,10 @@ The class for the [web font icon](https://docs.telerik.com/kendo-ui/styles-and-l
547555
}
548556
],
549557
dataSource: {
550-
data: [ { name: "Jane Doe" } ],
558+
data: [ {Id: 1, name: "Jane Doe" } ],
551559
schema: {
552560
model: {
561+
id: "Id",
553562
fields: {
554563
name: { type: "string" }
555564
}
@@ -580,9 +589,10 @@ The class for the [web font icon](https://docs.telerik.com/kendo-ui/styles-and-l
580589
}
581590
],
582591
dataSource: {
583-
data: [ { name: "Jane Doe" } ],
592+
data: [ {Id: 1, name: "Jane Doe" } ],
584593
schema: {
585594
model: {
595+
id: "Id",
586596
fields: {
587597
name: { type: "string" }
588598
}
@@ -608,9 +618,10 @@ The name of the command. The built-in commands are "edit" and "destroy". Can be
608618
],
609619
editable: "popup",
610620
dataSource: {
611-
data: [ { name: "Jane Doe" } ],
621+
data: [ {Id: 1, name: "Jane Doe" } ],
612622
schema: {
613623
model: {
624+
id: "Id",
614625
fields: {
615626
name: { type: "string" }
616627
}
@@ -664,9 +675,10 @@ The text displayed by the command button and the "cancel", "edit" and "update" t
664675
],
665676
editable: true,
666677
dataSource: {
667-
data: [ { name: "Jane Doe" } ],
678+
data: [ {Id: 1, name: "Jane Doe" } ],
668679
schema: {
669680
model: {
681+
id: "Id",
670682
fields: {
671683
name: { type: "string" }
672684
}
@@ -717,9 +729,10 @@ The "edit" text of the edit command.
717729
],
718730
editable: "inline",
719731
dataSource: {
720-
data: [ { name: "Jane Doe" } ],
732+
data: [ {Id: 1, name: "Jane Doe" } ],
721733
schema: {
722734
model: {
735+
id: "Id",
723736
fields: {
724737
name: { type: "string" }
725738
}
@@ -744,9 +757,10 @@ The "cancel" text of the edit command.
744757
],
745758
editable: "inline",
746759
dataSource: {
747-
data: [ { name: "Jane Doe" } ],
760+
data: [ {Id: 1, name: "Jane Doe" } ],
748761
schema: {
749762
model: {
763+
id: "Id",
750764
fields: {
751765
name: { type: "string" }
752766
}
@@ -771,9 +785,10 @@ The "update" text of the edit command.
771785
],
772786
editable: "inline",
773787
dataSource: {
774-
data: [ { name: "Jane Doe" } ],
788+
data: [ {Id: 1, name: "Jane Doe" } ],
775789
schema: {
776790
model: {
791+
id: "Id",
777792
fields: {
778793
name: { type: "string" }
779794
}
@@ -2397,7 +2412,7 @@ The fields which can be used in the template are:
23972412

23982413
### columns.groupFooterTemplate `String|Function`
23992414

2400-
The [template](/api/javascript/kendo/methods/template) which renders the group footer when the grid is grouped by the column field. By default the group footer is not displayed.
2415+
The [template](/api/javascript/kendo/methods/template) which renders the group footer for the corresponding column. By default the group footer is not displayed. The group footer will always appear as long as at least one column has a defined groupFooterTemplate.
24012416

24022417
The fields which can be used in the template are:
24032418

src/kendo.listview.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ var __meta__ = { // jshint ignore:line
4545
KEDITITEM = "k-edit-item",
4646
PAGER_CLASS = "k-listview-pager",
4747
ITEM_CLASS = "k-listview-item",
48-
TABINDEX = "tabindex",
4948
ARIA_SETSIZE = "aria-setsize",
5049
ARIA_POSINSET = "aria-posinset",
5150
ARIA_ROLE = "role",
@@ -246,8 +245,6 @@ var __meta__ = { // jshint ignore:line
246245
this.content = this.element;
247246
}
248247

249-
this.content.attr(TABINDEX, -1);
250-
251248
if (height) {
252249
this.element.css("height", height);
253250
}
@@ -718,7 +715,7 @@ var __meta__ = { // jshint ignore:line
718715
active = activeElement(), idx,
719716
scrollable = that.options.scrollable;
720717

721-
if (!target.is(that.element) || (!canHandle && !isTextBox && key !== keys.ESC) || (isTextBox && key !== keys.ESC && key !== keys.ENTER)) {
718+
if (target.hasClass(PAGER_CLASS) || (!canHandle && !isTextBox && key !== keys.ESC) || (isTextBox && key !== keys.ESC && key !== keys.ENTER)) {
722719
return;
723720
}
724721

@@ -880,6 +877,7 @@ var __meta__ = { // jshint ignore:line
880877
index = editable.element.index();
881878
editable.element.replaceWith(template(data));
882879
item = that.items().eq(index);
880+
item.addClass(ITEM_CLASS);
883881
item.attr(kendo.attr("uid"), data.uid);
884882
item.attr(ARIA_ROLE, role);
885883

@@ -988,11 +986,10 @@ var __meta__ = { // jshint ignore:line
988986

989987
_crudHandlers: function() {
990988
var that = this,
991-
mousedownNs = MOUSEDOWN + NS,
992989
touchstartNs = TOUCHSTART + NS,
993990
clickNs = CLICK + NS;
994991

995-
that.content.on(mousedownNs + " " + touchstartNs, ".k-edit-button", function(e) {
992+
that.content.on(touchstartNs + " " + clickNs, ".k-edit-button", function(e) {
996993
e.preventDefault();
997994
var item = $(this).closest("[" + kendo.attr("uid") + "]");
998995
setTimeout(function() {
@@ -1001,7 +998,7 @@ var __meta__ = { // jshint ignore:line
1001998
});
1002999

10031000

1004-
that.content.on(mousedownNs + " " + touchstartNs, ".k-delete-button", function(e) {
1001+
that.content.on(touchstartNs + " " + clickNs, ".k-delete-button", function(e) {
10051002
e.preventDefault();
10061003
var item = $(this).closest("[" + kendo.attr("uid") + "]");
10071004
setTimeout(function() {

0 commit comments

Comments
 (0)