Skip to content

Commit bdb2540

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 5c1dc68 commit bdb2540

File tree

6 files changed

+170
-1
lines changed

6 files changed

+170
-1
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Razor Pages Integration
3+
page_title: Razor Pages Integration with Progress<sup>®</sup> Telerik<sup>®</sup> UI for ASP.NET Core | Telerik UI for ASP.NET Core
4+
description: "Razor Pages Integration with Progress Telerik UI for ASP.NET Core (aka MVC 6 or ASP.NET Core MVC)."
5+
slug: razor_pages_integration_aspnetmvc6_aspnetmvc
6+
position: 5
7+
---
8+
9+
# Razor Pages Integration
10+
11+
All Telerik UI for ASP.NET Core components are compatible with the ASP.NET Razor Pages framework.
12+
13+
## Scaffolding Templates
14+
15+
You can scaffold a Razor Pages sample which contains an ASP.NET Core Grid with enabled CRUD operations using our **Create New Project Wizard**. To get started with the **Create New Project Wizard**, refer to the [Creating Projects]({% slug newprojectwizards_visualstudio_aspnetcore %}) article.
16+
17+
## Sample Applications
18+
19+
More Razor Pages samples which demonstrate Telerik UI for ASP.NET Core components usage can be found in our [ASP.NET Core Examples](https://github.com/telerik/ui-for-aspnet-core-examples) repository.
20+
21+
## See Also
22+
23+
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects]({% slug gettingstarted_aspnetmvc6_aspnetmvc %})
24+
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects with the CLI]({% slug gettingstartedcli_aspnetmvc6_aspnetmvc %})
25+
* [Known Issues with Telerik UI for ASP.NET Core]({% slug knownissues_aspnetmvc6_aspnetmvc %})
26+
* [Tag Helpers for ASP.NET Core]({% slug taghelpers_aspnetmvc6_aspnetmvc %})
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects
3+
description: An example on how to Send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects.
4+
type: how-to
5+
page_title: Send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects | Kendo UI Grid
6+
slug: grid-send-antiforgery-token
7+
tags: kendoui, kendo, grid, core, mvc, anti, forgery, token, antiforgery, send, antiforgerytoken
8+
res_type: kb
9+
component: grid
10+
---
11+
12+
## Description
13+
14+
How can I send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects?
15+
16+
## Solution
17+
18+
To include an antiforgery token within the requests of the grid is necessary to add an antyforgery token to the page which contains the grid and using the Transport.Data handler send the token as a parameter.
19+
20+
```
21+
@Html.AntiForgeryToken()
22+
23+
@(Html.Kendo().Grid<OrderViewModel>()
24+
.Name("grid")
25+
.Groupable()
26+
.Sortable()
27+
.Editable()
28+
.Scrollable()
29+
.ToolBar(x => x.Excel())
30+
.Columns(columns =>
31+
{
32+
columns.Bound(column => column.Freight);
33+
columns.Bound(column => column.ShipName);
34+
columns.Bound(column => column.ShipCity);
35+
columns.Command(column =>
36+
{
37+
column.Edit();
38+
column.Destroy();
39+
});
40+
})
41+
.Excel(excel => excel
42+
.FileName("Export.xlsx")
43+
.Filterable(true)
44+
.ProxyURL("/Index?handler=Save")
45+
)
46+
.DataSource(ds => ds.Ajax()
47+
.Read(r => r.Url("/Index?handler=Read").Data("forgeryToken"))
48+
.Update(u => u.Url("/Index?handler=Update").Data("forgeryToken"))
49+
.Create(c => c.Url("/Index?handler=Create").Data("forgeryToken"))
50+
.Destroy(d => d.Url("/Index?handler=Destroy").Data("forgeryToken"))
51+
.Model(m => m.Id(id => id.OrderID))
52+
.PageSize(10)
53+
)
54+
.Pageable()
55+
)
56+
57+
<script>
58+
function forgeryToken() {
59+
return kendo.antiForgeryTokens();
60+
}
61+
</script>
62+
```
63+
64+
## Notes
65+
66+
The [kendo.antiforgerytokens](https://docs.telerik.com/kendo-ui/api/javascript/kendo/methods/antiforgerytokens) method returns an object that contains common CSRF tokens found on the page.

src/kendo.calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var __meta__ = { // jshint ignore:line
5252
OUTOFRANGE = "k-out-of-range",
5353
TODAY = "k-nav-today",
5454
CELLSELECTOR = "td:has(.k-link)",
55-
CELLSELECTORVALID = "td:has(.k-link:not(." + DISABLED + ")):not(." + OUTOFRANGE + ")",
55+
CELLSELECTORVALID = "td:has(.k-link):not(." + DISABLED + "):not(." + OUTOFRANGE + ")",
5656
WEEKCOLUMNSELECTOR = "td:not(:has(.k-link))",
5757
SELECTED = "k-state-selected",
5858
BLUR = "blur" + ns,

src/kendo.list.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,7 @@ var __meta__ = { // jshint ignore:line
17951795
endY = tapPosition(e);
17961796

17971797
if (Math.abs(endY - startY) < 10) {
1798+
e.preventDefault();
17981799
that.trigger("click", { item: $(e.target.closest(ITEMSELECTOR)) });
17991800
}
18001801
});

tests/calendar/selection.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
(function() {
2+
3+
var Calendar = kendo.ui.Calendar,
4+
instance,
5+
div;
6+
7+
describe("kendo.ui.Calendar selection", function () {
8+
beforeEach(function() {
9+
10+
div = $("<div />").appendTo(Mocha.fixture);
11+
});
12+
afterEach(function() {
13+
14+
instance.destroy();
15+
kendo.destroy(Mocha.fixture);
16+
});
17+
18+
$.fn.press = function(x, y, ctrlKey, metaKey) {
19+
return triggerEvent(this, "mousedown", {
20+
pageX: x,
21+
pageY: y,
22+
ctrlKey: ctrlKey,
23+
metaKey: metaKey
24+
});
25+
};
26+
27+
$.fn.move = function(x, y, ctrlKey, metaKey) {
28+
return triggerEvent(this, "mousemove", {
29+
pageX: x,
30+
pageY: y,
31+
ctrlKey: ctrlKey,
32+
metaKey: metaKey
33+
});
34+
};
35+
36+
$.fn.tap = function(info) {
37+
return triggerEvent(this, "click", info);
38+
};
39+
40+
$.fn.release = function(info) {
41+
info = $.extend({}, info);
42+
return triggerEvent(this, "mouseup", info);
43+
};
44+
45+
function triggerEvent(element, type, info) {
46+
element.trigger($.Event(type, info));
47+
48+
return element;
49+
};
50+
51+
it("disabled dates are not selected with drag to select", function() {
52+
instance = new Calendar(div, {
53+
selectable: "multiple",
54+
disableDates: ["we"]
55+
}),
56+
selectable = instance.selectable,
57+
firstSelectee = $(instance.element.find("tr:eq(2) td:has(.k-link)")[0]),
58+
secondSelectee = instance.element.find("tr:eq(3) td:has(.k-link)").last(),
59+
position = secondSelectee.offset();
60+
61+
firstSelectee.tap().press().move(position.left, position.top).release();
62+
63+
assert.isOk(instance.element.find("td.k-state-selected").length);
64+
assert.isOk(!instance.element.find("td.k-state-selected.k-state-disabled").length);
65+
});
66+
67+
});
68+
}());

typescript/kendo.all.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21532,6 +21532,10 @@ interface JQuery {
2153221532
kendoScheduler(options: kendo.ui.SchedulerOptions): JQuery;
2153321533
data(key: "kendoScheduler"): kendo.ui.Scheduler;
2153421534

21535+
kendoScrollView(): JQuery;
21536+
kendoScrollView(options: kendo.ui.ScrollViewOptions): JQuery;
21537+
data(key: "kendoScrollView"): kendo.ui.ScrollView;
21538+
2153521539
kendoSlider(): JQuery;
2153621540
kendoSlider(options: kendo.ui.SliderOptions): JQuery;
2153721541
data(key: "kendoSlider"): kendo.ui.Slider;
@@ -21556,6 +21560,10 @@ interface JQuery {
2155621560
kendoStockChart(options: kendo.dataviz.ui.StockChartOptions): JQuery;
2155721561
data(key: "kendoStockChart"): kendo.dataviz.ui.StockChart;
2155821562

21563+
kendoSwitch(): JQuery;
21564+
kendoSwitch(options: kendo.ui.SwitchOptions): JQuery;
21565+
data(key: "kendoSwitch"): kendo.ui.Switch;
21566+
2155921567
kendoTabStrip(): JQuery;
2156021568
kendoTabStrip(options: kendo.ui.TabStripOptions): JQuery;
2156121569
data(key: "kendoTabStrip"): kendo.ui.TabStrip;

0 commit comments

Comments
 (0)