Skip to content

Commit 52d5c12

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 4dfc7da commit 52d5c12

File tree

6 files changed

+196
-44
lines changed

6 files changed

+196
-44
lines changed

docs-aspnet/knowledge-base/grid-custom-pager-placed-outside.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
title: Implement a custom Pager for a Telerik UI Grid
23
description: An example on how to add a Pager with different custom functionalities and styles.
34
type: how-to
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
title: Filter both Parent and Child Grids in Hierarchy
3+
description: An example on how to apply filters on both parent and child Grids in Hierarchy.
4+
type: how-to
5+
page_title: Update Adjacent Cells in Rows in Inline Edit Mode | Kendo UI Grid for jQuery
6+
slug: grid-apply-filter-parent-child
7+
tags: grid, filter, parent, child, hierarchy, detail
8+
ticketid: 1573560
9+
res_type: kb
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tr>
16+
<td>Product</td>
17+
<td>Progress Kendo UI Grid</td>
18+
</tr>
19+
<tr>
20+
<td>Operating System</td>
21+
<td>All</td>
22+
</tr>
23+
<tr>
24+
<td>Browser</td>
25+
<td>All</td>
26+
</tr>
27+
<tr>
28+
<td>Browser Version</td>
29+
<td>All</td>
30+
</tr>
31+
</table>
32+
33+
## Description
34+
35+
How can I apply filter to both the parent and child Grids in Hierarchy?
36+
37+
## Solution
38+
39+
It is possible to perform filtering over the parent Grid and the child Grid by ensuring the fetching of the filtered data for the parent Grid has finished. This is done by applying the filter to the child Grid in the [`dataBound`](/api/javascript/ui/grid/events/databound) event handler of the parent one.
40+
41+
```dojo
42+
<button class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md" onclick="filter()">Filter Parent and Child</button>
43+
<div id="grid"></div>
44+
45+
<script type="text/x-kendo-template" id="template">
46+
<div class="orders"></div>
47+
</script>
48+
49+
<script>
50+
$(document).ready(function() {
51+
var element = $("#grid").kendoGrid({
52+
dataSource: {
53+
type: "odata",
54+
transport: {
55+
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Employees"
56+
},
57+
pageSize: 20,
58+
serverPaging: true,
59+
serverSorting: true
60+
},
61+
height: 400,
62+
filterable: true,
63+
sortable: true,
64+
pageable: false,
65+
detailTemplate: kendo.template($("#template").html()),
66+
detailInit: detailInit,
67+
dataBound: function() {
68+
this.expandRow(this.tbody.find("tr.k-master-row").first());
69+
},
70+
columns: [
71+
{
72+
field: "FirstName",
73+
title: "First Name",
74+
width: "120px"
75+
},
76+
{
77+
field: "LastName",
78+
title: "Last Name",
79+
width: "120px"
80+
},
81+
{
82+
field: "Country",
83+
width: "120px"
84+
},
85+
{
86+
field: "City",
87+
width: "120px"
88+
},
89+
{
90+
field: "Title"
91+
}
92+
]
93+
});
94+
});
95+
96+
function detailInit(e) {
97+
var detailRow = e.detailRow;
98+
99+
detailRow.find(".detailTabstrip").kendoTabStrip({
100+
animation: {
101+
open: { effects: "fadeIn" }
102+
}
103+
});
104+
105+
detailRow.find(".orders").kendoGrid({
106+
dataSource: {
107+
type: "odata",
108+
transport: {
109+
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
110+
},
111+
serverPaging: true,
112+
serverSorting: true,
113+
serverFiltering: true,
114+
pageSize: 7,
115+
filter: { field: "EmployeeID", operator: "eq", value: e.data.EmployeeID }
116+
},
117+
scrollable: false,
118+
filterable: true,
119+
sortable: true,
120+
pageable: true,
121+
columns: [
122+
{ field: "OrderID", title:"ID", width: "70px" },
123+
{ field: "ShipCountry", title:"Ship Country", width: "110px" },
124+
{ field: "ShipAddress", title:"Ship Address" },
125+
{ field: "ShipName", title: "Ship Name", width: "300px" }
126+
]
127+
});
128+
}
129+
130+
function filter() {
131+
var mainGrid = $("#grid").data("kendoGrid");
132+
mainGrid.dataSource.filter({ field: "City", operator: "eq", value: "Seattle" })
133+
mainGrid.bind("dataBound", function() {
134+
var detailGrid = $(".orders").data("kendoGrid");
135+
detailGrid.dataSource.filter({ field: "ShipCountry", operator: "eq", value: "Italy" })
136+
})
137+
}
138+
</script>
139+
```
140+
141+
## See Also
142+
143+
* [API Reference of the Grid](/api/javascript/ui/grid)
144+
* [The dataBound Event of the Grid](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/databound)

package-lock.json

Lines changed: 30 additions & 38 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
@@ -10,10 +10,10 @@
1010
"license": "Apache-2.0",
1111
"version": "1.0.0",
1212
"devDependencies": {
13-
"@progress/kendo-theme-bootstrap": "5.6.0",
14-
"@progress/kendo-theme-classic": "5.6.0",
15-
"@progress/kendo-theme-default": "5.6.0",
16-
"@progress/kendo-theme-material": "5.6.0",
13+
"@progress/kendo-theme-bootstrap": "5.7.0",
14+
"@progress/kendo-theme-classic": "5.7.0",
15+
"@progress/kendo-theme-default": "5.7.0",
16+
"@progress/kendo-theme-material": "5.7.0",
1717
"autoprefixer": "^9.1.5",
1818
"axe-core": "^4.4.2",
1919
"bootstrap": "^4.0.0",

src/kendo.textbox.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,19 @@ var __meta__ = {
130130
setOptions: function(options) {
131131
this.destroy();
132132

133-
this.element.unwrap();
134-
if (this._floatingLabelContainer) {
133+
if (this._inputLabel) {
135134
this._inputLabel.remove();
136135
this._inputLabel = null;
136+
}
137+
138+
if (this._floatingLabelContainer) {
139+
this.floatingLabel.destroy();
140+
this.floatingLabel = null;
141+
this.element.unwrap();
137142
this.element.unwrap();
138143
this._floatingLabelContainer = null;
144+
} else {
145+
this.element.unwrap();
139146
}
140147

141148
kendo.deepExtend(this.options, options);

tests/textbox/api.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
assert.equal(input.attr("disabled"), undefined);
2828
});
2929

30+
it("setOptions does not duplicate labels", function() {
31+
var textbox = new TextBox(input, { label: "Set name" });
32+
33+
textbox.setOptions({});
34+
35+
assert.equal($(".k-input-label").length, 1);
36+
});
37+
3038
it("enable(false) removes readonly attribute and no-click class", function() {
3139
var textbox = input.kendoTextBox().data("kendoTextBox");
3240

0 commit comments

Comments
 (0)