Skip to content

Commit 758fc12

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 848ff6b commit 758fc12

File tree

15 files changed

+817
-425
lines changed

15 files changed

+817
-425
lines changed

docs-aspnet/backwards-compatibility/2022-backwards-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ As of the 2022 R1 SP2 release the `Shape` configuration option of the Button com
7070

7171
**Scheduler**
7272

73-
As of the 2022 R1 SP1 release the Scheduler exposes a modified keyboard navigation behavior. The main reason behind the change is to make the widget a single Tab stop element on the page. This would allow easier navigation to and away from the Scheduler. Further details on the new keyboard navigation behavior could be found on the [Keyboard Navigation demo](https://demos.telerik.com/{{ site.platform }}/scheduler/selection).
73+
As of the 2022 R1 SP1 release the Scheduler exposes a modified keyboard navigation behavior. The main reason behind the change is to make the widget a single Tab stop element on the page. This would allow easier navigation to and away from the Scheduler. Further details on the new keyboard navigation behavior could be found on the [Keyboard Navigation demo](https://demos.telerik.com/{{ site.platform }}/scheduler/keyboard-navigation).
7474

7575
## {{ site.product }} 2022 R1
7676

docs-aspnet/html-helpers/helper-basics/content-security-policy.md

Lines changed: 62 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Call the method after all components declarations to serialize the deferred init
6060

6161
### Creating Content Security Policy Templates
6262

63-
Most of the components support templating options, which use the [Kendo UI Templates syntax](https://docs.telerik.com/kendo-ui/framework/templates/overview), for example, [Grid templates]({% slug htmlhelpers_grid_aspnetcore_templates_overview %}), [DropDownList templates]({% slug htmlhelpers_dropdownlist_templates_aspnetcore %}), and more. To avoid using the [inline](https://docs.telerik.com/kendo-ui/framework/templates/get-started-inline) and [external](https://docs.telerik.com/kendo-ui/framework/templates/get-started-external) Kendo UI templates and remove the `unsafe-eval` keyword from the `meta` tag of your Telerik UI for {{ site.framework }} application, you can define the templates in partial views and load them by using the overload of the template option that accepts {% if site.core %}`IHtmlContent`{% else %}`MvcHtmlString`{% endif %}. For more information on the CSP-Compatible templates, [refer to the Client Templates section]().
63+
Most of the components support templating options, which use the [Kendo UI Templates syntax](https://docs.telerik.com/kendo-ui/framework/templates/overview), for example, [Grid templates]({% slug htmlhelpers_grid_aspnetcore_templates_overview %}), [DropDownList templates]({% slug htmlhelpers_dropdownlist_templates_aspnetcore %}), and more. To avoid using the [inline](https://docs.telerik.com/kendo-ui/framework/templates/get-started-inline) and [external](https://docs.telerik.com/kendo-ui/framework/templates/get-started-external) Kendo UI templates and remove the `unsafe-eval` keyword from the `meta` tag of your Telerik UI for {{ site.framework }} application, you can define the templates in partial views and load them by using the overload of the template option that accepts {% if site.core %}`IHtmlContent`{% else %}`MvcHtmlString`{% endif %}. For more information on the CSP-compatible templates, [refer to the CSP-compatible templates section]({% slug client_templates_overview %}#content-security-policy-csp-templates).
6464

65-
The example below demonstrates how to define a CSP-Compatible [client detail template of a Grid]({% slug clientdetailtemplate_grid_aspnetcore %}).
65+
The example below demonstrates how to define a CSP-compatible [client detail template of a Grid]({% slug clientdetailtemplate_grid_aspnetcore %}). You can pass either the relative or absolute path to the partial view in the `ClientDetailTemplateView` method.
6666

6767
{% if site.core %}
6868
```HtmlHelper
@@ -74,17 +74,69 @@ The example below demonstrates how to define a CSP-Compatible [client detail tem
7474
columns.Bound(product => product.CategoryName);
7575
})
7676
.Pageable()
77-
.ClientDetailTemplate(await Html.PartialAsync("DetailTemplate"))
77+
.ClientDetailTemplateView(await Html.PartialAsync("../GridPartials/DetailTemplate.cshtml")) // The "DetailTemplate.cshtml" is added in "~/Views/GridPartials/" directory.
7878
.DataSource(dataSource => dataSource
7979
.Ajax()
8080
.PageSize(20)
8181
.Read(read => read.Action("Categories_Read", "Home"))
8282
)
83-
.Deferred()
8483
)
8584
8685
@Html.Kendo().DeferredScriptFile()
8786
```
87+
```TagHelper
88+
@addTagHelper *, Kendo.Mvc
89+
90+
@{
91+
// The "DetailTemplateTagHelper.cshtml" is added in "~/Views/GridPartials/" directory.
92+
var detailTemplate = await Html.PartialAsync("../GridPartials/DetailTemplateTagHelper.cshtml");
93+
}
94+
95+
<kendo-grid name="grid" detail-template-view="detailTemplate">
96+
<columns>
97+
<column field="CategoryID"/>
98+
<column field="CategoryName"/>
99+
</columns>
100+
<pageable enabled="true"/>
101+
<datasource type="DataSourceTagHelperType.Ajax" page-size="20">
102+
<schema>
103+
<model id="CategoryID">
104+
<fields>
105+
<field name="CategoryID" type="number"></field>
106+
<field name="CategoryName" type="string"></field>
107+
</fields>
108+
</model>
109+
</schema>
110+
<transport>
111+
<read url="@Url.Action("Categories_Read","Home")"/>
112+
</transport>
113+
</datasource>
114+
</kendo-grid>
115+
```
116+
```DetailTemplateTagHelper.cshtml
117+
// Partial View that contains the detail TagHelper Grid.
118+
@addTagHelper *, Kendo.Mvc
119+
@{
120+
Layout = null;
121+
var url = @Url.Action("Products_Read", "Home");
122+
}
123+
124+
<kendo-grid name="grid_#=CategoryID#" is-in-client-template="true">
125+
<columns>
126+
<column field="ProductID"/>
127+
<column field="ProductName"/>
128+
</columns>
129+
<datasource type="DataSourceTagHelperType.Ajax" page-size="20">
130+
<schema data="Data" total="Total" errors="Errors">
131+
</schema>
132+
<transport>
133+
<read url="@Html.Raw(url+"?categoryId=#=CategoryID#")" />
134+
</transport>
135+
</datasource>
136+
<pageable enabled="true" />
137+
</kendo-grid>
138+
139+
```
88140
{% else %}
89141
```HtmlHelper
90142
@(Html.Kendo().Grid<KendoGridClientHierarchy.Models.Category>()
@@ -95,19 +147,19 @@ The example below demonstrates how to define a CSP-Compatible [client detail tem
95147
columns.Bound(product => product.CategoryName);
96148
})
97149
.Pageable()
98-
.ClientDetailTemplate(Html.Partial("DetailTemplate"))
150+
.ClientDetailTemplateView(Html.Partial("../GridPartials/DetailTemplate.cshtml")) // The "DetailTemplate.cshtml" is added in "~/Views/GridPartials/" directory.
99151
.DataSource(dataSource => dataSource
100152
.Ajax()
101153
.PageSize(20)
102154
.Read(read => read.Action("Categories_Read", "Home"))
103155
)
104-
.Deferred()
105156
)
106157
107158
@Html.Kendo().DeferredScriptFile()
108159
```
109160
{% endif %}
110-
```PartialView_DetailTemplate.cshtml
161+
```DetailTemplate.cshtml
162+
// Partial View that contains the detail Grid.
111163
@{
112164
Layout = null;
113165
}
@@ -121,36 +173,14 @@ The example below demonstrates how to define a CSP-Compatible [client detail tem
121173
})
122174
.DataSource(dataSource => dataSource
123175
.Ajax()
176+
.PageSize(20)
124177
.Read(read => read.Action("Products_Read", "Home", new { categoryId = "#=CategoryID#" }))
125178
)
126179
.Pageable()
180+
.ToClientTemplate()
127181
)
128182
```
129183

130-
Alternatively, you can rewrite all [inline](https://docs.telerik.com/kendo-ui/framework/templates/get-started-inline) and [external](https://docs.telerik.com/kendo-ui/framework/templates/get-started-external) templates into [CSP-compatible functional templates](https://docs.telerik.com/kendo-ui/framework/templates/get-started-csp-templates).
131-
132-
```HtmlHelper
133-
@(Html.Kendo().Grid<KendoGridClientHierarchy.Models.Category>()
134-
.Name("grid")
135-
.Columns(columns =>
136-
{
137-
columns.Bound(product => product.CategoryName)
138-
.ClientTemplate("<span>Name: ${kendo.htmlEncode(CategoryName)}</span>")
139-
})
140-
...
141-
)
142-
```
143-
{% if site.core %}
144-
```TagHelper
145-
<kendo-grid name="grid">
146-
<columns>
147-
<column field="CategoryName" template="<span>Name: ${kendo.htmlEncode(CategoryName)}</span>"></column>
148-
</columns>
149-
...
150-
</kendo-grid>
151-
```
152-
{% endif %}
153-
154184
The engine for the [inline](https://docs.telerik.com/kendo-ui/framework/templates/get-started-inline) and [external](https://docs.telerik.com/kendo-ui/framework/templates/get-started-external) templates will remain available. However, if you are using the previous template syntax, you must include the `usafe-eval` directive in the `meta` tag.
155185

156186
## (Prior to R1 2023 SP1) Working with Telerik UI for {{ site.framework }} Components
@@ -204,6 +234,7 @@ The Telerik UI for {{ site.framework }} releases prior to the R1 2023 SP1 one do
204234
205235
## See Also
206236
237+
* [Content Security Policy (CSP) Templates]({% slug client_templates_overview %}#content-security-policy-(csp)-templates)
207238
* [Content Security Policy in Kendo UI for jQuery](https://docs.telerik.com/kendo-ui/troubleshoot/content-security-policy)
208239
* [Getting Started with Content Security Policy (CSP) Templates in Kendo UI for jQuery](https://docs.telerik.com/kendo-ui/framework/templates/get-started-csp-templates)
209240

docs-aspnet/html-helpers/helper-basics/fundamentals-mvc.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ To defer individual components:
9090
@Html.Kendo().DeferredScriptsFor("age", false)
9191
</script>
9292

93-
* Use the `DeferredScriptFile` method to serialize the deferred initialization script to a file.
93+
* Use the `DeferredScriptFile` method to serialize the deferred initialization script to a file. The method simulates loading the initialization scripts as a `JS` file through an `HttpModule`. To use this feature, enable the required settings described in the [deferring components globally section](#deferring-components-globally).
9494

9595
@Html.Kendo().DeferredScriptFile()
9696

@@ -124,7 +124,8 @@ To defer components globally:
124124
</configuration>
125125
```
126126
127-
1. Serialize the script tag into a file by adding `@(Html.Kendo().DeferredScriptFile())` after all components declarations. Any components registered after it will not be included in the script.
127+
1. Serialize the script tag into a file by adding `@(Html.Kendo().DeferredScriptFile())` after all components declarations.
128+
Any components registered after it will not be included in the script.
128129
129130
Alternatively, call the `DeferredScripts` method to format the components scripts as inline script.
130131
@@ -228,22 +229,6 @@ If you have deferred the initialization of the component, make sure you get its
228229
});
229230
</script>
230231

231-
## Using Client Templates
232-
233-
By default, every Telerik UI helper renders a script element with an initialization statement. If the helper declaration is placed inside a Kendo UI template, the nested script elements will be invalid. The `ToClientTemplate` method instructs the helper to escape its own script element so that it can be nested.
234-
235-
<script id="template" type="text/x-kendo-template">
236-
@(Html.Kendo().NumericTextBox()
237-
.Name("age").ToClientTemplate()
238-
)
239-
</script>
240-
<div id="container"></div>
241-
<script>
242-
$(function () {
243-
var template = kendo.template($("#template").html());
244-
$("#container").append( template ({}) );
245-
})
246-
</script>
247232

248233
## Rendering of Forms
249234

@@ -323,5 +308,6 @@ The explanations and requirements in this section are applicable to all styleshe
323308

324309
## See Also
325310

311+
* [Using Client Templates]({% slug client_templates_overview %})
326312
* [Telerik UI for ASP.NET MVC Download and Installation]({% slug downloadinstall_aspnetcore %})
327313
* [Installing Telerik UI for ASP.NET MVC with NuGet]({% slug nuget_install_aspnetmvc6_aspnetmvc %})

docs-aspnet/html-helpers/helper-basics/fundamentals.md

Lines changed: 14 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ To defer individual components:
131131
@Html.Kendo().DeferredScriptsFor("age", false)
132132
</script>
133133
134-
* Use the `DeferredScriptFile` method to serialize the deferred initialization script to a file.
134+
* Use the `DeferredScriptFile` method to serialize the deferred initialization script to a file. The method simulates loading the initialization scripts as a `JS` file through a middleware. To use this feature, enable the required settings described in the [deferring components globally section](#deferring-components-globally).
135+
135136
136137
@Html.Kendo().DeferredScriptFile()
137138
@@ -144,6 +145,17 @@ To defer components globally:
144145
145146
1. Enable the `DeferToScriptFiles` setting in the `AddKendo` method that registers the Kendo UI service.
146147
148+
* For applications using .NET 6 or later and the [minimal hosting model](https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-6.0&tabs=visual-studio#new-hosting-model), the `AddKendo` method is defined in the `Program.cs` file.
149+
150+
```
151+
var builder = WebApplication.CreateBuilder(args);
152+
153+
builder.Services.AddKendo(x =>
154+
{
155+
x.DeferToScriptFiles = true;
156+
});
157+
```
158+
147159
* For applications using .NET 5 or earlier, the `AddKendo` method is defined in the `ConfigureServices` method in the `Startup.cs` file.
148160
149161
```
@@ -156,17 +168,6 @@ To defer components globally:
156168
}
157169
```
158170
159-
* For applications using .NET 6 or later and the [minimal hosting model](https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-6.0&tabs=visual-studio#new-hosting-model), the `AddKendo` method is defined in the `Program.cs` file.
160-
161-
```
162-
var builder = WebApplication.CreateBuilder(args);
163-
164-
builder.Services.AddKendo(x =>
165-
{
166-
x.DeferToScriptFiles = true;
167-
});
168-
```
169-
170171
1. Set the `KendoDefferedScriptsMiddleware` middleware. After the compilation of the views, all scripts are stored in the memory cache. When the browser requests the dynamic `js` file, this middleware handles the request and returns the cached scripts.
171172
172173
```
@@ -281,65 +282,8 @@ If you have deferred the initialization of the component, make sure you get its
281282
282283
```
283284

284-
## Using Client Templates
285-
286-
The Telerik UI for ASP.NET Core enables you to implement client templates for its [HTML Helper](#html-helper-client-templates) and [Tag Helper](#tag-helper-client-templates) components.
287-
288-
### HTML Helper Client Templates
289-
290-
By default, every Telerik UI helper renders a script element with an initialization statement. If the helper declaration is placed inside a Kendo UI template, the nested script elements will be invalid. The `ToClientTemplate` method instructs the helper to escape its own script element so that it can be nested.
291-
292-
<script id="template" type="text/x-kendo-template">
293-
@(Html.Kendo().NumericTextBox()
294-
.Name("age")
295-
.ToClientTemplate()
296-
)
297-
</script>
298-
<div id="container"></div>
299-
<script>
300-
$(function () {
301-
var template = kendo.template($("#template").html());
302-
$("#container").append( template ({}) );
303-
})
304-
</script>
305-
306-
### Tag Helper Client Templates
307-
308-
Тhe .NET framework ignores any Tag Helpers which are within script tags. In order to compile them correctly, when placing a Tag Helper within a Kendo Template, set the type to `text/html` and add the `is-in-client-template="true"` attribute.
309-
310-
The following example demonstrates how to include Chart TagHelpers in the TileLayout TagHelper.
311-
312-
<!-- container chart templates -->
313-
<script id="downloads-template" type="text/html">
314-
<kendo-chart name="downloads" is-in-client-template="true">
315-
<series>
316-
<series-item type="ChartSeriesType.Line" data="new double[] { 56000, 63000, 74000, 91000, 117000, 138000 }">
317-
</series-item>
318-
</series>
319-
</kendo-chart>
320-
</script>
321-
<script id="devices-template" type="text/html">
322-
<kendo-chart name="devices" is-in-client-template="true">
323-
<series>
324-
<series-item type="ChartSeriesType.Donut" auto-fit="true" data='new dynamic[] {
325-
new {category = "Asia",value = 30.8,color = "\\#006634"},
326-
new {category = "Europe",value = 69.2,color = "\\#90cc38"}}'>
327-
</series-item>
328-
</series>
329-
</kendo-chart>
330-
</script>
331-
<kendo-tilelayout name="tilelayout" columns="2" resizable="true" reorderable="true">
332-
<containers>
333-
<container body-template-id="downloads-template" col-span="1" row-span="1">
334-
<container-header text="Weekly Recap-Downloads" />
335-
</container>
336-
<container body-template-id="devices-template" col-span="1" row-span="1">
337-
<container-header text="Devices" />
338-
</container>
339-
</containers>
340-
</kendo-tilelayout>
341-
342285
## See Also
343286

287+
* [Using Client Templates]({% slug client_templates_overview %})
344288
* [JSON Serialization]({% slug jsonserialization_core %})
345289
* [Kendo UI Templates](https://docs.telerik.com/kendo-ui/framework/templates/overview)

0 commit comments

Comments
 (0)