Skip to content

Commit 8085339

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 378c754 commit 8085339

27 files changed

+521
-124
lines changed

docs-aspnet/_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ navigation:
356356
"html-helpers/navigation/bottomnavigation":
357357
title: "BottomNavigation"
358358
isNew: true
359+
"tag-helpers/navigation/appbar":
360+
title: "AppBar"
361+
isNew: true
359362
"tag-helpers/navigation/bottomnavigation":
360363
title: "BottomNavigation"
361364
isNew: true
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
page_title: The Telerik UI Filter in RazorPages
2+
description: "Telerik UI Filter for {{ site.framework }} in a RazorPages application."
3+
slug: razorpages_filterhelper_aspnetcore
4+
position: 2
5+
---
6+
7+
# Telerik UI Filter in Razor Pages
8+
9+
Razor Pages are an alternative to the MVC pattern. Razor Pages make page-focused coding easier and more productive. This approach consists of a `cshtml` file and a `cs` file (generally, the two files have the same name). You can seamlessly integrate the Telerik UI Filter for {{ site.framework }} in Razor Pages applications.
10+
11+
For a runnable example, refer to the [Filter in RazorPages example](https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.RazorPages/Telerik.Examples.RazorPages/Pages/Filter/FilterBinding.cshtml).
12+
13+
## Getting Started
14+
15+
To configure the Telerik UI Filter widget within a `RazorPage`:
16+
17+
1. Configure the Read URL in the `DataSource`. The URL in these methods must refer to the method name in the `PageModel`:
18+
19+
20+
```
21+
@(Html.Kendo().DataSource<CustomerViewModel>()
22+
.Name("dataSource1")
23+
.Ajax(t =>
24+
{
25+
t.Read(r=>r.Url("/Filter/FilterBinding?handler=Customers").Data("forgeryToken"));
26+
t.Model(model => model.Id(p => p.CustomerID));
27+
t.PageSize(20);
28+
})
29+
)
30+
31+
@(Html.Kendo().Filter<CustomerViewModel>()
32+
.Name("filter")
33+
.ApplyButton(true)
34+
.ExpressionPreview(true)
35+
.Fields(f =>
36+
{
37+
f.Add(p=>p.CustomerID);
38+
f.Add(p=>p.Position);
39+
f.Add(p=>p.CompanyName);
40+
f.Add(p=>p.Country);
41+
})
42+
.FilterExpression(f => {
43+
f.Add(p => p.Position).IsEqualTo("Sales Representative");
44+
})
45+
.DataSource("dataSource1")
46+
)
47+
```
48+
49+
1. Add an AntiForgeryToken at the top of the RazorPage:
50+
51+
52+
```
53+
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
54+
@Html.AntiForgeryToken()
55+
```
56+
57+
1. Send the AntiForgeryToken with each POST request of the page. Additional parameters can also be supplied:
58+
59+
60+
```
61+
<script>
62+
function forgeryToken() {
63+
return kendo.antiForgeryTokens();
64+
}
65+
</script>
66+
```
67+
68+
1. Within the `.cs` file, introduce ActionMethod for the Read operation
69+
70+
```
71+
public JsonResult OnPostCustomers([DataSourceRequest]DataSourceRequest request)
72+
{
73+
return new JsonResult(Customers.ToDataSourceResult(request)); // Where Customers is a colection of objects
74+
}
75+
```
76+
77+
## See Also
78+
79+
* [Server-Side API](/api/filter)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
page_title: The Telerik UI MaskedTextBox in RazorPages
2+
description: "Telerik UI MaskedTextBox for {{ site.framework }} in a RazorPages application."
3+
slug: razorpages_maskedtextboxhelper_aspnetcore
4+
position: 5
5+
---
6+
7+
# Telerik UI MaskedTextBox in Razor Pages
8+
9+
Razor Pages are an alternative to the MVC pattern. Razor Pages make page-focused coding easier and more productive. This approach consists of a `cshtml` file and a `cs` file (generally, the two files have the same name). You can seamlessly integrate the Telerik UI MaskedTextBox for {{ site.framework }} in Razor Pages applications.
10+
11+
For a runnable example, refer to the [MaskedTextBox in RazorPages example](https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.RazorPages/Telerik.Examples.RazorPages/Pages/MaskedTextBox/MaskedTextBoxEditing.cshtml).
12+
13+
## Getting Started
14+
15+
To bind the Telerik UI MaskedTextBox within a `RazorPage`:
16+
17+
1. Declare the `PageModel` at the top of the `RazorPage`:
18+
19+
20+
```
21+
@page
22+
@model Telerik.Examples.RazorPages.Pages.MaskedTextBox.MaskedTextBoxEditingModel
23+
```
24+
25+
1. Declare the widget either in a form or as a stand-alone widget:
26+
27+
28+
```
29+
<form method="post">
30+
<label for="phone_number">Phone number:</label>
31+
@(Html.Kendo().MaskedTextBoxFor(c=>c.PhoneNumber)
32+
.Mask("(999) 000-0000")
33+
)
34+
<br />
35+
<input type="submit" name="name" value="Submit Form" />
36+
</form>
37+
```
38+
39+
1. Bind the property values in the backend:
40+
41+
```
42+
public class MaskedTextBoxEditingModel : PageModel
43+
{
44+
[BindProperty]
45+
public string PhoneNumber { get; set; }
46+
47+
public void OnGet()
48+
{
49+
//omitted for clarity
50+
}
51+
52+
public void OnPost()
53+
{
54+
//omitted for clarity
55+
}
56+
}
57+
```
58+
59+
## See Also
60+
61+
* [Server-Side API](/api/maskedtextbox)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
page_title: The Telerik UI NumericTextBox in RazorPages
2+
description: "Telerik UI NumericTextBox for {{ site.framework }} in a RazorPages application."
3+
slug: razorpages_numerictextboxhelper_aspnetcore
4+
position: 6
5+
---
6+
7+
# Telerik UI NumericTextBox in Razor Pages
8+
9+
Razor Pages are an alternative to the MVC pattern. Razor Pages make page-focused coding easier and more productive. This approach consists of a `cshtml` file and a `cs` file (generally, the two files have the same name). You can seamlessly integrate the Telerik UI NumericTextBox for {{ site.framework }} in Razor Pages applications.
10+
11+
For a runnable example, refer to the [NumericTextBox in RazorPages example](https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.RazorPages/Telerik.Examples.RazorPages/Pages/NumericTextBox/NumericTextBoxBinding.cshtml).
12+
13+
## Getting Started
14+
15+
To bind the Telerik UI NumericTextBox within a `RazorPage`:
16+
17+
1. Declare the `PageModel` at the top of the `RazorPage`:
18+
19+
20+
```
21+
@page
22+
@model Telerik.Examples.RazorPages.Pages.NumericTextBoxBindingModel
23+
```
24+
25+
1. Declare the widget either in a form or as a stand-alone widget:
26+
27+
28+
```
29+
<form method="post">
30+
<label for="Price">Price:</label>
31+
@(Html.Kendo().NumericTextBoxFor(c=>c.Price)
32+
.Step(1)
33+
.Min(0)
34+
.Decimals(0)
35+
)
36+
<br />
37+
<input type="submit" name="name" value="Submit Form" />
38+
</form>
39+
```
40+
41+
1. Bind the property values in the backend:
42+
43+
```
44+
public class NumericTextBoxBindingModel : PageModel
45+
{
46+
[BindProperty]
47+
public int Price { get; set; }
48+
49+
public void OnGet()
50+
{
51+
//omitted for clarity
52+
}
53+
public void OnPost()
54+
{
55+
//omitted for clarity
56+
}
57+
}
58+
```
59+
60+
## See Also
61+
62+
* [Server-Side API](/api/numerictextbox)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Items
3+
page_title: Items
4+
description: "Learn how to configure the items of the AppBar component."
5+
slug: taghelpers_items_appbar_aspnetcore
6+
position: 2
7+
---
8+
9+
# Items
10+
11+
The `items` represent the content of the AppBar. The [`items`](/api/javascript/ui/appbar/configuration/items) configuration accepts a collection of objects that will be rendered inside the AppBar widget. There are two types of items that developers can choose from:
12+
13+
* [Content Items](#content-items)
14+
* [Spacer](#spacer)
15+
16+
## Content Items
17+
18+
There are two approaches to using templates with **Content Items**:
19+
* You can use the the `template` option exposed by `AppBarItemType.ContentItem` to consume and render HTML.
20+
* You can supply a `kendo.template` reference to the configuration.
21+
22+
The following example shows how to utilize both approaches:
23+
24+
```tagHelper
25+
@addTagHelper *, Kendo.Mvc
26+
27+
<kendo-appbar name="appbar" theme-color="AppBarThemeColor.Inherit" >
28+
<items>
29+
<appbar-item type="AppBarItemType.ContentItem" template="<a class='k-button' href='\\#'><span class='k-icon k-i-menu'></span></a>"></appbar-item>
30+
<appbar-item type="AppBarItemType.ContentItem" template-id="search-template"></appbar-item>
31+
</items>
32+
</kendo-appbar>
33+
34+
<script id="search-template" type="text/x-kendo-tmpl">
35+
<span class="k-textbox k-display-flex">
36+
<input autocomplete="off" placeholder="Search..." title="Search..." class="k-input">
37+
<span class="k-input-icon">
38+
<span class="k-icon k-i-search"></span>
39+
</span>
40+
</span>
41+
</script>
42+
```
43+
44+
## Spacer
45+
46+
The `AppBarItemType.Spacer` item could be utilized to easily separate the content items from one another.
47+
48+
```tagHelper
49+
@addTagHelper *, Kendo.Mvc
50+
51+
<kendo-appbar name="appbar" theme-color="AppBarThemeColor.Inherit" >
52+
<items>
53+
<appbar-item type="AppBarItemType.ContentItem" template="<h3 class='title'>All Products</h3>"></appbar-item>
54+
<appbar-item type="AppBarItemType.Spacer" width="16px"></appbar-item>
55+
<appbar-item type="AppBarItemType.ContentItem" template="<a class='k-button k-clear-search' href='\\#'>Clear search</a>"></appbar-item>
56+
</items>
57+
</kendo-appbar>
58+
```
59+
60+
## See Also
61+
62+
* [Basic Usage of the AppBar TagHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/appbar/tag-helper)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Overview
3+
page_title: Overview
4+
description: "Learn the basics when working with the Telerik AppBar TagHelper for ASP.NET Core."
5+
slug: taghelpers_appbar_aspnetcore_overview
6+
position: 1
7+
---
8+
9+
# AppBar TagHelper Overview
10+
11+
The Telerik UI AppBar TagHelper for {{ site.framework }} is a server-side wrapper for the Kendo UI AppBar widget.
12+
13+
The AppBar widget a navigational widget. It is template-driven, which makes it very flexible - it can render whatever you throw at it. To take full advantage of its functionality, you can include various Content Items in the AppBar widget
14+
15+
Visit the [Demo page for the AppBar](https://demos.telerik.com/aspnet-core/appbar/tag-helper) to see it in action.
16+
17+
## Basic Configuration
18+
19+
The following example demonstrates how to initialize the AppBar using the TagHelper wrapper.
20+
21+
```tagHelper
22+
@addTagHelper *, Kendo.Mvc
23+
24+
<kendo-appbar name="appbar" theme-color="AppBarThemeColor.Inherit">
25+
<items>
26+
<appbar-item type="AppBarItemType.ContentItem" template="<a class='k-button' href='\\#'><span class='k-icon k-i-menu'></span></a>"></appbar-item>
27+
<appbar-item type="AppBarItemType.Spacer" width="16px"></appbar-item>
28+
<appbar-item type="AppBarItemType.ContentItem" template-id="search-template"></appbar-item>
29+
</items>
30+
</kendo-appbar>
31+
```
32+
33+
## Functionality and Features
34+
35+
* [Items]({% slug taghelpers_items_appbar_aspnetcore %}) - the configuration allows you to set various attributes like templates, classes and titles.
36+
* [Positioning]({% slug taghelpers_positioning_appbar_aspnetcore %}) - the configuration allows you to modify the position of the component and how it is changed when the page is scrolled.
37+
38+
## Events
39+
40+
You can subscribe to the AppBar widget's events.
41+
42+
```tagHelper
43+
@addTagHelper *, Kendo.Mvc
44+
45+
<kendo-appbar name="appbar" theme-color="AppBarThemeColor.Inherit" on-resize="onResize">
46+
<items>
47+
<appbar-item type="AppBarItemType.ContentItem" template="<a class='k-button' href='\\#'><span class='k-icon k-i-menu'></span></a>"></appbar-item>
48+
<appbar-item type="AppBarItemType.Spacer" width="16px"></appbar-item>
49+
<appbar-item type="AppBarItemType.ContentItem" template-id="search-template"></appbar-item>
50+
</items>
51+
</kendo-appbar>
52+
53+
<script>
54+
function onResize(e){
55+
//handle the AppBar widget's resize event
56+
};
57+
</script>
58+
```
59+
60+
## See Also
61+
62+
* [Basic Usage of the AppBar TagHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/appbar/tag-helper)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Positioning
3+
page_title: Positioning
4+
description: "Learn how to configure the position of the AppBar component."
5+
slug: taghelpers_positioning_appbar_aspnetcore
6+
position: 3
7+
---
8+
9+
# Positioning
10+
11+
The AppBar widget enables you to set its [position](#position) and its [position mode](#position-mode).
12+
13+
## Position
14+
15+
The `position` option of the Kendo UI AppBar defines where the widget has to be positioned on the page. The predefined position options are the following:
16+
17+
* `AppBarPosition.None` - no positioning CSS style are applied
18+
* `AppBarPosition.Top` - places the AppBar at the top of the page
19+
* `AppBarPosition.Bottom` - places the AppBar at the bottom of the page
20+
21+
## Position Mode
22+
23+
The `position-mode` option defines the position of the widget relative to its parent container or viewport. The predefined **Position Mode** options are the following::
24+
25+
* `AppBarPositionMode.Static` - positions the AppBar according to the normal flow of the page.
26+
* `AppBarPositionMode.Sticky` - sticks the AppBar to a given position(top or bottom).
27+
* `AppBarPositionMode.Fixed`- positions the AppBar relative to the viewport.
28+
29+
> In order to use the `Sticky` or `Fixed` position mode of the AppBar, the `position` has to be set either to `Top` or `Bottom`.
30+
31+
## See Also
32+
33+
* [Basic Usage of the AppBar TagHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/appbar/tag-helper)
34+
* [JavaScript API Reference of the AppBar](/api/javascript/ui/appbar)

src/kendo.data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ var __meta__ = { // jshint ignore:line
22962296
currOriginal = originalGroup.items[i];
22972297
currentNew = newGroup.items[i];
22982298
if (currOriginal && currentNew) {
2299-
if (currOriginal.hasSubgroups) {
2299+
if (currOriginal.hasSubgroups && currOriginal.value == currentNew.value) {
23002300
fillLastGroup(currOriginal, currentNew);
23012301
} else if (currOriginal.field && currOriginal.value == currentNew.value) {
23022302
currOriginal.items.push.apply(currOriginal.items, currentNew.items);

0 commit comments

Comments
 (0)