Skip to content

Commit 9222d0e

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 840bdec commit 9222d0e

File tree

4 files changed

+146
-7
lines changed

4 files changed

+146
-7
lines changed

docs-aspnet/compatibility/json-serialization.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ There are three ways to configure JSON Serialization in ASP.NET Core 3:
3939

4040
* The recommended approach is to use the default serialization that is delivered with ASP.NET Core. To configure it, locate the `ConfigureServices` method and update it by adding the code below.
4141

42+
```
4243
public void ConfigureServices(IServiceCollection services)
4344
{
4445
...
@@ -50,9 +51,11 @@ There are three ways to configure JSON Serialization in ASP.NET Core 3:
5051
// Add the Kendo UI services to the services container.
5152
services.AddKendo();
5253
}
54+
```
5355

5456
* The first alternative approach is to maintain the property names casing globally, locate the `ConfigureServices` method and update it by adding the `using Newtonsoft.Json.Serialization;` line at the top.
5557

58+
```
5659
...
5760
using Newtonsoft.Json.Serialization;
5861
...
@@ -68,9 +71,11 @@ There are three ways to configure JSON Serialization in ASP.NET Core 3:
6871
// Add the Kendo UI services to the services container.
6972
services.AddKendo();
7073
}
74+
```
7175

7276
* The second alternative approach is to use the default Json serialization throughout the application and include the built-in `System.Text.Json.JsonSerializerOptions` in the controller action method response.
7377

78+
```
7479
...
7580
using System.Text.Json;
7681
...
@@ -80,7 +85,8 @@ There are three ways to configure JSON Serialization in ASP.NET Core 3:
8085

8186
DataSourceResult result = orders.ToDataSourceResult(request);
8287
return Json(result, new JsonSerializerOptions() { PropertyNameCaseInsensitive = false });
83-
}
88+
}
89+
```
8490

8591
## See Also
8692

docs/api/javascript/dataviz/ui/diagram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9324,7 +9324,7 @@ Whether the removal should be recorded in the undo-redo stack.
93249324

93259325
### resize
93269326

9327-
Adjusts the diagram size to match the size of the container.
9327+
Adjusts the diagram viewport to match the size of the container.
93289328

93299329
#### Example - resize Diagram on window resize
93309330

docs/knowledge-base/datetimepicker-localization-modern-type.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,56 @@ res_type: kb
2323

2424
## Description
2525

26-
This sample demonstrates how to implement Dutch Culture and Localization for Kendo DateTimePicker in Modern ContentType.
26+
This sample demonstrates how to implement Globalization and Localization for Kendo DateTimePicker in Modern ContentType.
2727

2828
## Solution
2929

30-
```dojo
31-
30+
The first step is to include the culture resource script for the given language:
31+
https://docs.telerik.com/kendo-ui/api/javascript/ui/datetimepicker/configuration/culture
32+
33+
More info you can find here:
34+
https://docs.telerik.com/kendo-ui/framework/globalization/overview
35+
36+
Setting the culture will localize values like Month names, Day names, Date formatting, etc. For the rest of the values like Today, Cancel, Now, you may use one of the Localization options below:
37+
38+
### Option 1 (Recommended)
39+
40+
Use kendo-messages. These resource files are community-driven and we appreciate our users contributing to them:
41+
https://github.com/telerik/kendo-ui-core/tree/master/src/messages
42+
43+
More info you can find here:
44+
https://docs.telerik.com/kendo-ui/globalization/localization
45+
46+
Here is a full sample:
47+
48+
```dojo
49+
<script src="https://kendo.cdn.telerik.com/2020.3.1021/js/cultures/kendo.culture.bg-BG.min.js"></script>
50+
<script src="https://kendo.cdn.telerik.com/2020.3.1021/js/messages/kendo.messages.bg-BG.min.js"></script>
51+
52+
<p>Modern Picker with Bulgarian Localization</p>
53+
54+
<input id="datetimepicker" />
55+
56+
<script>
57+
kendo.culture("bg-BG");
58+
59+
var picker = $("#datetimepicker").kendoDateTimePicker({
60+
componentType: "modern",
61+
}).data().kendoDateTimePicker;
62+
</script>
63+
```
64+
65+
### Option 2
66+
67+
This is a custom approach by modifying the values directly in the DOM elements using JavaScript:
68+
69+
```dojo
70+
<script src="https://kendo.cdn.telerik.com/2020.3.1021/js/cultures/kendo.culture.nl-NL.min.js"> </script>
71+
3272
<p>Modern Picker with Dutch Localization</p>
33-
73+
3474
<input id="datetimepicker" />
35-
75+
3676
<script>
3777
kendo.culture("nl-NL");
3878
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: Scale Diagram to Fit Container upon Resizing
3+
description: An example on how to scale Kendo UI Diagram to fit its container upon resizing
4+
type: how-to
5+
page_title: Scale Diagram to Fit its Container upon Resizing | Kendo UI Diagram for jQuery
6+
slug: scale-diagram-to-fit-container-upon-resizing
7+
tags: diagram, scale, resize
8+
ticketid: 1492478
9+
res_type: kb
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tr>
16+
<td>Product</td>
17+
<td>Progress Kendo UI Diagram</td>
18+
</tr>
19+
</table>
20+
21+
22+
## Description
23+
24+
How can I scale Kendo UI Diagram to fit its container upon resizing?
25+
26+
## Solution
27+
28+
Create a method to dynamically calculate the Diagram viewport dimensions and scale the Diagram accordingly. Use the [`scale()`](/api/javascript/dataviz/ui/diagram/methods/scale) method of the Diagram.
29+
30+
```dojo
31+
<div class="diagram-wrapper">
32+
<div id="diagram"></div>
33+
</div
34+
<script>
35+
$("#diagram").kendoDiagram({
36+
shapes:[
37+
{
38+
id:"1",
39+
content:{
40+
text: "State 1"
41+
},
42+
x: 20,
43+
y: 20
44+
},
45+
{
46+
id:"2",
47+
content: {
48+
text: "State 2"
49+
},
50+
x: 650,
51+
y: 20
52+
}
53+
],
54+
connections:[
55+
{
56+
from: "1",
57+
to: "2"
58+
}
59+
]
60+
});
61+
62+
function ResizeDiagram() {
63+
var diagram = $("#diagram").data("kendoDiagram"); //get instance of the Diagram
64+
var boundingbox = diagram.boundingBox();
65+
var viewport = diagram.viewport();
66+
67+
var vpW = viewport.width; //get Diagram viewport width
68+
var vpH = viewport.height; //get Diagram viewport height
69+
var bbW = boundingbox.width; //get Diagram boundingbox width
70+
var bbH = boundingbox.height; //get Diagram boundingbox height
71+
72+
var ratioW = vpW / bbW;
73+
var ratioH = vpH / bbH;
74+
75+
//zoom Diagram based on width ratio and height ratio
76+
if (ratioW < ratioH) {
77+
diagram.zoom(ratioW * .95);
78+
}
79+
else {
80+
diagram.zoom(ratioH * .95);
81+
}
82+
}
83+
84+
$(window).on("resize", function () {
85+
ResizeDiagram();
86+
});
87+
</script>
88+
```
89+
## See Also
90+
91+
* [Diagram Overview](https://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/diagram/overview)
92+
* [Persist Shape Properties](https://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/diagram/how-to/persist-shape-properties)
93+
* [Diagram Layout](https://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/diagram/layout)

0 commit comments

Comments
 (0)