Skip to content

Commit 08ffc56

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 3d41819 commit 08ffc56

File tree

9 files changed

+268
-9
lines changed

9 files changed

+268
-9
lines changed

docs-aspnet/_config-mvc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ html-helpers/editors/dropdowntree/binding/razor-page.md,
6262
html-helpers/editors/multicolumncombobox/binding/razor-page.md,
6363
html-helpers/editors/multiselect/binding/razor-page.md,
6464
html-helpers/layout/form/razor-page.md,
65+
html-helpers/layout/dialog/razor-page.md,
66+
html-helpers/navigation/button/razor-page.md,
67+
html-helpers/navigation/menu/binding/razor-page.md,
68+
html-helpers/navigation/menu/contextmenu/razor-page.md,
6569
html-helpers/scheduling/scheduler/binding/razor-page.md]
6670

6771
exclude_navigation: ["knowledge-base/*",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Razor Page
3+
page_title: Configure a Dialog in Razor Page.
4+
description: "An example on how to configure the Telerik UI Dialog HtmlHelper for {{ site.framework }} in a Razor Page."
5+
slug: htmlhelpers_dialog_razorpage_aspnetcore
6+
position: 5
7+
---
8+
9+
# Razor Page
10+
11+
This article describes how to configure the Telerik UI Dialog HtmlHelper for {{ site.framework }} in a RazorPage scenario.
12+
13+
The example below demonstrates how to pass antiforgery token when an action from the Dialog is clicked. See the implementation details in the example below, and for the full project with RazorPages examples, visit our [GitHub repository](https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/Telerik.Examples.RazorPages).
14+
15+
```tab-RazorPage(csthml)
16+
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
17+
@Html.AntiForgeryToken()
18+
19+
@(Html.Kendo().Dialog()
20+
.Name("dialog")
21+
.Title("Data Update")
22+
.Content("<p>Would you like to confirm updating the data?<p>")
23+
.Width(400)
24+
.Modal(false)
25+
.Actions(actions =>
26+
{
27+
actions.Add().Text("Cancel");
28+
actions.Add().Text("Send data").Primary(true).Action("onSendData");
29+
})
30+
)
31+
32+
<script>
33+
function onSendData() {
34+
$.ajax({
35+
url: "/Dialog/DialogIndex",
36+
type: "POST",
37+
headers: {
38+
RequestVerificationToken: kendo.antiForgeryTokens().__RequestVerificationToken
39+
},
40+
dataType: "json"
41+
});
42+
}
43+
</script>
44+
```
45+
```tab-PageModel(cshtml.cs)
46+
47+
public void OnPost()
48+
{
49+
....
50+
}
51+
```
52+
53+
## See Also
54+
55+
* [Razor Pages Support]({% slug razor_pages_integration_aspnetmvc6_aspnetmvc %})
56+
* [Dialog Overview]({% slug overview_dialoghelper_aspnetcore %})
57+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Razor Page
3+
page_title: Configure a submit Button in Razor Page.
4+
description: "An example on how to configure the Telerik UI Button HtmlHelper for {{ site.framework }} in a Razor Page."
5+
slug: htmlhelpers_button_razorpage_aspnetcore
6+
position: 4
7+
---
8+
9+
# Razor Page
10+
11+
This article describes how to configure the Telerik UI Button HtmlHelper for {{ site.framework }} in a RazorPage scenario.
12+
13+
The example below demonstrates how to pass antiforgery token when a Button is clicked. See the implementation details in the example below, and for the full project with RazorPages examples, visit our [GitHub repository](https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/Telerik.Examples.RazorPages).
14+
15+
```tab-RazorPage(csthml)
16+
17+
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
18+
@Html.AntiForgeryToken()
19+
20+
<form method="post">
21+
<input type="text" name="description">
22+
<br/>
23+
@(Html.Kendo().Button()
24+
.Name("primaryTextButton")
25+
.HtmlAttributes(new { type = "submit", @class = "k-primary" })
26+
.Events(e => e.Click("onClick"))
27+
.Content("Submit")
28+
)
29+
</form>
30+
31+
<script>
32+
function onClick() {
33+
return kendo.antiForgeryTokens();
34+
}
35+
</script>
36+
```
37+
```tab-PageModel(cshtml.cs)
38+
39+
public class ButtonIndexModel : PageModel
40+
{
41+
public void OnPost(string description)
42+
{
43+
.....
44+
}
45+
}
46+
```
47+
48+
## See Also
49+
50+
* [Razor Pages Support]({% slug razor_pages_integration_aspnetmvc6_aspnetmvc %})
51+
* [Button Overview]({% slug htmlhelpers_button_aspnetcore %})
52+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Razor Page
3+
page_title: Configure a DataSource for the Menu for Remote Binding in Razor Page.
4+
description: "An example on how to configure the remote binding DataSource to populate the Telerik UI Menu HtmlHelper for {{ site.framework }} ."
5+
slug: htmlhelpers_menu_razorpage_aspnetcore
6+
position: 5
7+
---
8+
9+
# Razor Page
10+
11+
This article describes how to configure a Remote DataSource of a Telerik Menu in a RazorPage scenario.
12+
13+
In order to set up the Menu component bindings, you need to configure the `Read` method of its `DataSource` instance. The URL in this method should refer the name of the method in the PageModel. In this method, you can also pass additional parameters, such as filter string and antiforgery token (see `dataFunction`). See the implementation details in the example below, and for the full project with RazorPages examples, visit our [GitHub repository](https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/Telerik.Examples.RazorPages).
14+
15+
```tab-RazorPage(csthml)
16+
17+
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
18+
@Html.AntiForgeryToken()
19+
20+
@(Html.Kendo().Menu()
21+
.Name("Menu")
22+
.DataTextField("Name")
23+
.DataSource(ds => ds
24+
.Read(r => r
25+
.Url("/Menu/MenuRemoteData?handler=Read").Data("dataFunction")
26+
)
27+
.Model(model => model.Children("Products")))
28+
)
29+
30+
<script>
31+
function dataFunction() {
32+
return kendo.antiForgeryTokens();
33+
}
34+
</script>
35+
```
36+
```tab-PageModel(cshtml.cs)
37+
38+
public JsonResult OnGetRead()
39+
{
40+
//categories is the DBContext
41+
var result = categories.ToList().Select((category) =>
42+
new
43+
{
44+
Name = category.CategoryName,
45+
Products = category.Products
46+
.Where((product) => product.CategoryID == category.CategoryID)
47+
.Select((product) => new { Name = product.ProductName })
48+
}
49+
);
50+
return new JsonResult(result);
51+
}
52+
```
53+
54+
## See Also
55+
56+
* [Razor Pages Support]({% slug razor_pages_integration_aspnetmvc6_aspnetmvc %})
57+
* [DataBinding Overview]({% slug htmlhelpers_menu_databinding_aspnetcore %})
58+

docs-aspnet/html-helpers/navigation/menu/contextmenu/keyboard-navigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Keyboard Navigation
33
page_title: Keyboard Navigation
44
description: "Learn how to use the keyboard navigation functionality of the Telerik UI ContextMenu HtmlHelper for {{ site.framework }}."
55
slug: htmlhelpers_contextmenu_keyboardnavigation_aspnetcore
6-
position: 3
6+
position: 4
77
---
88

99
# Keyboard Navigation
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: Razor Page
3+
page_title: Configure a ContextMenu in Razor Page.
4+
description: "An example on how to configure the Telerik UI Button HtmlHelper for {{ site.framework }} in a Razor Page."
5+
slug: htmlhelpers_contextmenu_razorpage_aspnetcore
6+
position: 3
7+
---
8+
9+
# Razor Page
10+
11+
This article describes how to configure the Telerik UI ContextMenu HtmlHelper for {{ site.framework }} in a RazorPage scenario.
12+
13+
The example below demonstrates how to pass antiforgery token when an item from the ContextMenu is selected. See the implementation details in the example below, and for the full project with RazorPages examples, visit our [GitHub repository](https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/Telerik.Examples.RazorPages).
14+
15+
```tab-RazorPage(csthml)
16+
17+
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
18+
@Html.AntiForgeryToken()
19+
20+
<div id="target">Right click here</div>
21+
22+
@(Html.Kendo().ContextMenu()
23+
.Name("RequestMenu")
24+
.Target("#target")
25+
.Orientation(ContextMenuOrientation.Vertical)
26+
.Items(items =>
27+
{
28+
items.Add()
29+
.Text("Edit");
30+
31+
items.Add()
32+
.Text("Cancel");
33+
})
34+
.Events(e =>
35+
{
36+
e.Select("onSelect");
37+
38+
})
39+
)
40+
41+
<script>
42+
function onSelect(e) {
43+
if ($(e.item).text() == "Edit") {
44+
$.ajax({
45+
url: "/ContextMenu/ContextMenuIndex?handler=Custom",
46+
type: "POST",
47+
contentType: "application/json",
48+
headers: {
49+
RequestVerificationToken: $('input:hidden[name="__RequestVerificationToken"]').val()
50+
}
51+
});
52+
}
53+
}
54+
</script>
55+
```
56+
```tab-PageModel(cshtml.cs)
57+
58+
public void OnPostCustom()
59+
{
60+
....
61+
}
62+
```
63+
64+
## See Also
65+
66+
* [Razor Pages Support]({% slug razor_pages_integration_aspnetmvc6_aspnetmvc %})
67+
* [ContextMenu Overview]({% slug htmlhelpers_contextmenu_aspnetcore %})
68+

docs-aspnet/installation/vs-integration/convert-project-wizard.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ To use the **Convert Project Wizard**, install the Telerik UI for ASP.NET Core V
1616

1717
- [Visual Studio MarketPlace](https://marketplace.visualstudio.com/items?itemName=TelerikInc.TelerikASPNETCoreVSExtensions) (for Windows)
1818
- **Telerik UI for ASP.NET Core automated installer** - from the `Downloads` tab of your [Telerik.com account](https://www.telerik.com/account/product-download?product=UIASPCORE) choose the [.msi (for Windows)]({% slug msi_install_aspnetmvc6_aspnetmvc %}) or .pkg (for Mac) installer.
19-
- **Visual Studio Extensions** archived files - from the `Downloads` tab of your [Telerik.com account](https://www.telerik.com/account/product-download?product=UIASPCORE) download Visual Studio Extensions `.zip` or `7z`.
2019

2120
## Start the Wizard
2221

src/kendo.multiselect.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,13 @@ var __meta__ = { // jshint ignore:line
595595
_listBound: function() {
596596
var that = this;
597597
var data = that.dataSource.flatView();
598-
var skip = that.listView.skip();
599598

600599
that._render(data);
601-
602600
that._renderFooter();
603601
that._renderNoData();
604602
that._toggleNoData(!data.length);
605-
606603
that._resizePopup();
604+
that._updateItemFocus();
607605

608606
if (that._open) {
609607
that._open = false;
@@ -612,10 +610,6 @@ var __meta__ = { // jshint ignore:line
612610

613611
that.popup.position();
614612

615-
if (that.options.highlightFirst && (skip === undefined || skip === 0)) {
616-
that.listView.focusFirst();
617-
}
618-
619613
if (that._touchScroller) {
620614
that._touchScroller.reset();
621615
}
@@ -626,6 +620,21 @@ var __meta__ = { // jshint ignore:line
626620
that.trigger("dataBound");
627621
},
628622

623+
_updateItemFocus: function() {
624+
var that = this,
625+
data = that.dataSource.flatView(),
626+
skip = that.listView.skip(),
627+
isFirstPage = skip === undefined || skip === 0;
628+
629+
if (data.length && isFirstPage) {
630+
if (!that.options.highlightFirst) {
631+
that.listView.focus(-1);
632+
} else {
633+
that.listView.focusFirst();
634+
}
635+
}
636+
},
637+
629638
_inputValue: function() {
630639
var that = this;
631640
var inputValue = that.input.val();

tests/multiselect/initialization.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,18 @@
554554
assert.equal(multiselect.listView.calls("focusFirst"), 1);
555555
});
556556

557+
it("do not highlight first item when autoBind is false", function() {
558+
popuplateSelect();
559+
var multiselect = new MultiSelect(select, {
560+
highlightFirst: false,
561+
autoBind: false
562+
});
563+
564+
multiselect.open();
565+
566+
assert.equal(multiselect.current(), null);
567+
});
568+
557569
it("Copy accesskey to the visible input", function() {
558570
popuplateSelect();
559571
var multiselect = new MultiSelect(select.attr("accesskey", "w"), { highlightFirst: false });

0 commit comments

Comments
 (0)