Skip to content

Commit 41a8c80

Browse files
committed
Sync with Kendo UI Professional
1 parent cc87ae6 commit 41a8c80

26 files changed

+519
-202
lines changed

docs-aspnet/html-helpers/data-management/grid/toolbar.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ When you use a Toolbar Template, and you also want to use a built-in command, th
117117
```HtmlHelper
118118
<script id="GridToolbarTemplate" type="text/x-kendo-template">
119119
<div class="refreshBtnContainer">
120-
<a href="\\#" class="k-pager-refresh k-link k-button k-button-solid-base k-button-solid k-button-rectangle k-button-md k-rounded-md k-button-icon" title="Refresh"><span class="k-icon k-i-reload"></span></a>
120+
<a href="\\#" class="k-pager-refresh k-link k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-icon" title="Refresh"><span class="k-icon k-i-reload"></span></a>
121121
</div>
122122
123-
<a role="button" class="k-button k-button-solid-base k-button-solid k-button-rectangle k-button-md k-rounded-md k-button-icontext k-grid-pdf" href="\\#"><span class="k-icon k-i-file-pdf"></span>Export to PDF</a>
123+
<a role="button" class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-icontext k-grid-pdf" href="\\#"><span class="k-icon k-i-file-pdf"></span>Export to PDF</a>
124124
125125
<div class="toolbar">
126126
<label class="category-label" for="category">Show products by category:</label>
@@ -153,7 +153,7 @@ When you use a Toolbar Template, and you also want to use a built-in command, th
153153
<a href="\\#" class="k-pager-refresh k-link k-button k-button-solid-base k-button-solid k-button-rectangle k-button-md k-rounded-md k-button-icon" title="Refresh"><span class="k-icon k-i-reload"></span></a>
154154
</div>
155155
156-
<a role="button" class="k-button k-button-solid-base k-button-solid k-button-rectangle k-button-md k-rounded-md k-button-icontext k-grid-pdf" href="\\#"><span class="k-icon k-i-file-pdf"></span>Export to PDF</a>
156+
<a role="button" class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-icontext k-grid-pdf" href="\\#"><span class="k-icon k-i-file-pdf"></span>Export to PDF</a>
157157
158158
<div class="toolbar">
159159
<label class="category-label" for="category">Show products by category:</label>

docs-aspnet/html-helpers/scheduling/scheduler/pdf-export.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ The following example demonstrates how to handle custom fonts.
232232
233233
/* Hide toolbar, navigation and footer during export */
234234
.k-pdf-export .k-scheduler-toolbar,
235-
.k-pdf-export .k-scheduler-navigation .k-nav-today,
236-
.k-pdf-export .k-scheduler-navigation .k-nav-prev,
237-
.k-pdf-export .k-scheduler-navigation .k-nav-next,
235+
.k-pdf-export .k-scheduler-navigation [ref-nav-today],
236+
.k-pdf-export .k-scheduler-navigation [ref-nav-prev],
237+
.k-pdf-export .k-scheduler-navigation [ref-nav-next],
238238
.k-pdf-export .k-scheduler-footer {
239239
display: none;
240240
}

docs-aspnet/knowledge-base/scheduler-preserve-buttongroup-view-in-adaptive-rendering.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,22 @@ Follow the steps below to achieve the desired scenario:
179179
```Script.js
180180
<script>
181181
var buttonGroup = `<span data-role='buttongroup' class='k-widget k-button-group k-toolbar-button-group' role='group' data-uid='f01bcb47-94d9-4c40-8e55-53a28b45134d'>
182-
<button class='k-view-day k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-toolbar-tool k-group-start k-button-rectangle' data-name='day' data-uid='dda9916c-3486-4407-9a69-4d5acca5ab52' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views'>
182+
<button class='k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-group-start ' ref-view-day data-name='day' data-uid='dda9916c-3486-4407-9a69-4d5acca5ab52' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views' ref-toolbar-tool>
183183
<span class='k-button-text'>Day</span>
184184
</button>
185-
<button class='k-view-week k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-toolbar-tool k-button-rectangle' data-name='week' data-uid='faac8830-48a5-4b51-9574-9a6c39166b45' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views'>
185+
<button class='k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button ' data-name='week' ref-view-week data-uid='faac8830-48a5-4b51-9574-9a6c39166b45' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views' ref-toolbar-tool>
186186
<span class='k-button-text'>Week</span>
187187
</button>
188-
<button class='k-view-month k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-toolbar-tool k-button-rectangle k-selected' data-name='month' data-uid='be7bd46b-e9db-49ee-9d1f-aaee385d1884' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='true' data-group='views'>
188+
<button class='k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-selected' ref-view-month data-name='month' data-uid='be7bd46b-e9db-49ee-9d1f-aaee385d1884' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='true' data-group='views' ref-toolbar-tool>
189189
<span class='k-button-text'>Month</span>
190190
</button>
191-
<button class='k-view-year k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-toolbar-tool k-button-rectangle' data-name='year' data-uid='d5aa93e5-ea56-48b7-a878-5f427722fb18' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views'>
191+
<button class='k-view-year k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button ' data-name='year' data-uid='d5aa93e5-ea56-48b7-a878-5f427722fb18' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views' ref-toolbar-tool>
192192
<span class='k-button-text'>Year</span>
193193
</button>
194-
<button class='k-view-agenda k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-toolbar-tool k-button-rectangle' data-name='agenda' data-uid='bb93961e-ebe4-4e7a-bbaa-8fc4b8d69a90' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views'>
194+
<button class='k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button ' data-name='agenda' ref-view-agenda data-uid='bb93961e-ebe4-4e7a-bbaa-8fc4b8d69a90' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views' ref-toolbar-tool>
195195
<span class='k-button-text'>Agenda</span>
196196
</button>
197-
<button class='k-view-timeline k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-toolbar-tool k-group-end k-button-rectangle' data-name='timeline' data-uid='f137d9d3-02be-47a9-8b3c-9f13513f8090' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views'>
197+
<button class='k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-toggle-button k-group-end ' ref-view-timeline data-name='timeline' data-uid='f137d9d3-02be-47a9-8b3c-9f13513f8090' data-parentuid='f01bcb47-94d9-4c40-8e55-53a28b45134d' data-role='togglebutton' type='button' role='button' aria-disabled='false' tabindex='-1' aria-pressed='false' data-group='views' ref-toolbar-tool>
198198
<span class='k-button-text'>Timeline</span>
199199
</button>
200200
</span>`;

docs/controls/mediaplayer/accessibility/keyboard-navigation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ The MediaPlayer supports the following keyboard shortcuts:
2020
|`Esc` |Exits the full-screen mode.
2121
|`Space` |Toggles the play and pause state.
2222
|`M` |Toggles the mute and unmute state.
23+
| `RightArrow` | Seek forward.
24+
| `LeftArrow` | Seek backward.
25+
| `UpArrow` | Increase the volume.
26+
| `DownArrow` | Decrease the volume.
27+
| `Control + 1` | Decrease the video quality.
28+
| `Control + 2` | Increase the video quality.
2329

2430
## See Also
2531

docs/knowledge-base/add-control-to-customeditor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The following example demonstrates how to achieve the desired scenario.
122122
var container = e.container;
123123
124124
/* ACTION: Ading a custom button. */
125-
var newButton = $('<a class="k-button k-button-md k-button-rectangle k-rounded-md k-button-solid k-button-solid-base" href="#">New button</a>');
125+
var newButton = $('<a class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base" href="#">New button</a>');
126126
127127
// Wire its click event.
128128
newButton.click(function(e) { alert("Clicked"); });

docs/knowledge-base/add-icon-custom-tool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ The following example demonstrates how to decorate your own custom tool with a F
8080
</script>
8181
8282
<style>
83-
.k-editor .k-toolbar-tool[title="Custom tool 1"] .k-icon:before {
83+
.k-editor [ref-toolbar-tool][title="Custom tool 1"] .k-icon:before {
8484
font-family: FontAwesome;
8585
content: "\f09e";
8686
}
8787
88-
.k-editor .k-toolbar-tool[title="Custom tool 2"] .k-icon:before {
88+
.k-editor [ref-toolbar-tool][title="Custom tool 2"] .k-icon:before {
8989
font-family: FontAwesome;
9090
content: "\f061";
9191
}

docs/knowledge-base/agenda-view-pdf-export-with-paging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To achieve the desired scenario, use the [drawing API]({% slug multipagecontent_
4444
<!-- Load Pako ZLIB library to enable PDF compression -->
4545
<script src="https://unpkg.com/pako/dist/pako_deflate.min.js"></script>
4646
<div id="example">
47-
<button id="export" class="k-button k-button-md k-button-rectangle k-rounded-md k-button-solid k-button-solid-base">Export to PDF</button>
47+
<button id="export" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base">Export to PDF</button>
4848
<div id="scheduler"></div>
4949
</div>
5050
<script>
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
---
2+
title: Programmatically Changing the Width of a Grid Column
3+
description: Learn how to programmatically adjust the width of columns in a Kendo UI Grid.
4+
type: how-to
5+
page_title: How to Adjust Column Widths Programmatically in Kendo UI Grid
6+
slug: how-to-programmatically-change-grid-column-width-kendo-ui
7+
tags: grid, kendo ui, column width, setoptions, javascript
8+
res_type: kb
9+
ticketid: 1666957
10+
---
11+
12+
## Description
13+
14+
When working with the [Grid](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid) for Progress® Kendo UI®, you might need to programmatically change the width of one or more columns. This article demonstrates how to adjust column widths dynamically. This KB article also answers the following questions:
15+
- How to set column widths dynamically in a Kendo UI Grid?
16+
- Can I update Grid column settings after initialization?
17+
- How to use `setOptions()` method to modify Grid properties?
18+
19+
## Environment
20+
21+
<table>
22+
<tbody>
23+
<tr>
24+
<td>Product</td>
25+
<td>Grid for Progress® Kendo UI®</td>
26+
</tr>
27+
<tr>
28+
<td>Version</td>
29+
<td>2024.3.1015</td>
30+
</tr>
31+
</tbody>
32+
</table>
33+
34+
## Solution
35+
36+
To programmatically change the width of Grid columns, use the [`setOptions()`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/setoptions) method. This approach allows you to update the Grid's column widths after it has been initialized. Follow these steps:
37+
38+
1. Define a list with the desired widths for each column.
39+
40+
```javascript
41+
const list_of_columns_width = [500, 110, 120, 130, 50, 60];
42+
```
43+
44+
2. Obtain a reference to the Grid instance.
45+
46+
```javascript
47+
let grid = $("#grid").data("kendoGrid");
48+
```
49+
50+
3. Iterate over the Grid columns and apply the widths from `list_of_columns_width`.
51+
52+
```javascript
53+
let gridColumns = grid.columns;
54+
55+
for (var i = 0; i < grid.columns.length; i++) {
56+
if (i < list_of_columns_width.length) {
57+
const any_column_width = list_of_columns_width[i];
58+
gridColumns[i].width = any_column_width;
59+
}
60+
}
61+
```
62+
63+
4. Update the Grid's options with the modified columns.
64+
65+
```javascript
66+
grid.setOptions({
67+
columns: gridColumns
68+
});
69+
```
70+
71+
Note: Use the `setOptions()` method with caution and avoid calling it inside event handlers like [`dataBound`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/databound) to prevent endless loops.
72+
73+
When updating the Grid's columns using `setOptions()`, all other Grid options remain as initially defined. Only the specified options (in this case, column widths) are updated.
74+
75+
Explore a live example in the following Dojo demo:
76+
77+
```dojo
78+
<div id="example">
79+
<div id="grid"></div>
80+
81+
<script>
82+
$(document).ready(function() {
83+
const list_of_columns_width = [500, 110, 120, 130 ,50, 60];
84+
$("#grid").kendoGrid({
85+
dataSource: {
86+
type: "odata",
87+
transport: {
88+
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
89+
},
90+
schema: {
91+
model: {
92+
fields: {
93+
OrderID: {
94+
type: "number"
95+
},
96+
ShipCountry: {
97+
type: "string"
98+
},
99+
ShipCity: {
100+
type: "string"
101+
},
102+
ShipName: {
103+
type: "string"
104+
},
105+
OrderDate: {
106+
type: "date"
107+
},
108+
ShippedDate: {
109+
type: "date"
110+
}
111+
}
112+
}
113+
},
114+
pageSize: 15
115+
},
116+
height: 550,
117+
sortable: true,
118+
resizable: true,
119+
pageable: true,
120+
dataBound: function() {
121+
for (var i = 0; i < this.columns.length; i++) {
122+
if (i < list_of_columns_width.length) {
123+
const any_column = this.columns[i];
124+
const any_column_width = list_of_columns_width[i];
125+
any_column.width = any_column_width
126+
}
127+
}
128+
},
129+
columns: [
130+
{
131+
field: "OrderDate",
132+
title: "Order Date",
133+
format: "{0:MM/dd/yyyy}"
134+
},
135+
{
136+
field: "ShipCountry",
137+
title: "Ship Country"
138+
},
139+
{
140+
field: "ShipCity",
141+
title: "Ship City"
142+
},
143+
{
144+
field: "ShipName",
145+
title: "Ship Name"
146+
},
147+
{
148+
field: "ShippedDate",
149+
title: "Shipped Date",
150+
format: "{0:MM/dd/yyyy}"
151+
},
152+
{
153+
field: "OrderID",
154+
title: "ID"
155+
}
156+
157+
]
158+
});
159+
160+
let grid = $("#grid").data("kendoGrid");
161+
let gridColumns = grid.columns;
162+
163+
for (var i = 0; i < grid.columns.length; i++) {
164+
if (i < list_of_columns_width.length) {
165+
166+
const any_column_width = list_of_columns_width[i];
167+
gridColumns[i].width = any_column_width;
168+
}
169+
}
170+
grid.setOptions({
171+
columns: gridColumns
172+
});
173+
});
174+
</script>
175+
</div>
176+
```
177+
178+
## See Also
179+
180+
- [Grid Overview](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid)
181+
- [Grid setOptions() Method](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/setoptions)
182+
- [Grid DataBound Event](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/databound)

docs/knowledge-base/timeline-with-dynamic-length.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The following example demonstrates how to achieve the desired scenario.
9090
views: [{
9191
type: "MyCustomTimelistView",
9292
selected: true,
93-
dateHeaderTemplate: "<span class='k-link k-nav-day'>#=kendo.toString(date, ' dd/M ddd')#</span>"
93+
dateHeaderTemplate: "<span class='k-link' ref-view-day >#=kendo.toString(date, ' dd/M ddd')#</span>"
9494
}],
9595
timezone: "Etc/UTC",
9696
dataSource: {

0 commit comments

Comments
 (0)