Skip to content

Commit

Permalink
Sync with Kendo UI Professional
Browse files Browse the repository at this point in the history
  • Loading branch information
Kendo Bot committed Jan 15, 2019
1 parent 5c1dc68 commit bdb2540
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docs-aspnet-core/getting-started/razor-pages-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Razor Pages Integration
page_title: Razor Pages Integration with Progress<sup>®</sup> Telerik<sup>®</sup> UI for ASP.NET Core | Telerik UI for ASP.NET Core
description: "Razor Pages Integration with Progress Telerik UI for ASP.NET Core (aka MVC 6 or ASP.NET Core MVC)."
slug: razor_pages_integration_aspnetmvc6_aspnetmvc
position: 5
---

# Razor Pages Integration

All Telerik UI for ASP.NET Core components are compatible with the ASP.NET Razor Pages framework.

## Scaffolding Templates

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.

## Sample Applications

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.

## See Also

* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects]({% slug gettingstarted_aspnetmvc6_aspnetmvc %})
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects with the CLI]({% slug gettingstartedcli_aspnetmvc6_aspnetmvc %})
* [Known Issues with Telerik UI for ASP.NET Core]({% slug knownissues_aspnetmvc6_aspnetmvc %})
* [Tag Helpers for ASP.NET Core]({% slug taghelpers_aspnetmvc6_aspnetmvc %})
66 changes: 66 additions & 0 deletions docs/knowledge-base/grid-send-antiforgery-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects
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.
type: how-to
page_title: Send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects | Kendo UI Grid
slug: grid-send-antiforgery-token
tags: kendoui, kendo, grid, core, mvc, anti, forgery, token, antiforgery, send, antiforgerytoken
res_type: kb
component: grid
---

## Description

How can I send an antiforgery token with the requests of a Grid in ASP.NET Core and ASP.NET MVC projects?

## Solution

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.

```
@Html.AntiForgeryToken()
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Groupable()
.Sortable()
.Editable()
.Scrollable()
.ToolBar(x => x.Excel())
.Columns(columns =>
{
columns.Bound(column => column.Freight);
columns.Bound(column => column.ShipName);
columns.Bound(column => column.ShipCity);
columns.Command(column =>
{
column.Edit();
column.Destroy();
});
})
.Excel(excel => excel
.FileName("Export.xlsx")
.Filterable(true)
.ProxyURL("/Index?handler=Save")
)
.DataSource(ds => ds.Ajax()
.Read(r => r.Url("/Index?handler=Read").Data("forgeryToken"))
.Update(u => u.Url("/Index?handler=Update").Data("forgeryToken"))
.Create(c => c.Url("/Index?handler=Create").Data("forgeryToken"))
.Destroy(d => d.Url("/Index?handler=Destroy").Data("forgeryToken"))
.Model(m => m.Id(id => id.OrderID))
.PageSize(10)
)
.Pageable()
)
<script>
function forgeryToken() {
return kendo.antiForgeryTokens();
}
</script>
```

## Notes

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.
2 changes: 1 addition & 1 deletion src/kendo.calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var __meta__ = { // jshint ignore:line
OUTOFRANGE = "k-out-of-range",
TODAY = "k-nav-today",
CELLSELECTOR = "td:has(.k-link)",
CELLSELECTORVALID = "td:has(.k-link:not(." + DISABLED + ")):not(." + OUTOFRANGE + ")",
CELLSELECTORVALID = "td:has(.k-link):not(." + DISABLED + "):not(." + OUTOFRANGE + ")",
WEEKCOLUMNSELECTOR = "td:not(:has(.k-link))",
SELECTED = "k-state-selected",
BLUR = "blur" + ns,
Expand Down
1 change: 1 addition & 0 deletions src/kendo.list.js
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,7 @@ var __meta__ = { // jshint ignore:line
endY = tapPosition(e);

if (Math.abs(endY - startY) < 10) {
e.preventDefault();
that.trigger("click", { item: $(e.target.closest(ITEMSELECTOR)) });
}
});
Expand Down
68 changes: 68 additions & 0 deletions tests/calendar/selection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
(function() {

var Calendar = kendo.ui.Calendar,
instance,
div;

describe("kendo.ui.Calendar selection", function () {
beforeEach(function() {

div = $("<div />").appendTo(Mocha.fixture);
});
afterEach(function() {

instance.destroy();
kendo.destroy(Mocha.fixture);
});

$.fn.press = function(x, y, ctrlKey, metaKey) {
return triggerEvent(this, "mousedown", {
pageX: x,
pageY: y,
ctrlKey: ctrlKey,
metaKey: metaKey
});
};

$.fn.move = function(x, y, ctrlKey, metaKey) {
return triggerEvent(this, "mousemove", {
pageX: x,
pageY: y,
ctrlKey: ctrlKey,
metaKey: metaKey
});
};

$.fn.tap = function(info) {
return triggerEvent(this, "click", info);
};

$.fn.release = function(info) {
info = $.extend({}, info);
return triggerEvent(this, "mouseup", info);
};

function triggerEvent(element, type, info) {
element.trigger($.Event(type, info));

return element;
};

it("disabled dates are not selected with drag to select", function() {
instance = new Calendar(div, {
selectable: "multiple",
disableDates: ["we"]
}),
selectable = instance.selectable,
firstSelectee = $(instance.element.find("tr:eq(2) td:has(.k-link)")[0]),
secondSelectee = instance.element.find("tr:eq(3) td:has(.k-link)").last(),
position = secondSelectee.offset();

firstSelectee.tap().press().move(position.left, position.top).release();

assert.isOk(instance.element.find("td.k-state-selected").length);
assert.isOk(!instance.element.find("td.k-state-selected.k-state-disabled").length);
});

});
}());
8 changes: 8 additions & 0 deletions typescript/kendo.all.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21532,6 +21532,10 @@ interface JQuery {
kendoScheduler(options: kendo.ui.SchedulerOptions): JQuery;
data(key: "kendoScheduler"): kendo.ui.Scheduler;

kendoScrollView(): JQuery;
kendoScrollView(options: kendo.ui.ScrollViewOptions): JQuery;
data(key: "kendoScrollView"): kendo.ui.ScrollView;

kendoSlider(): JQuery;
kendoSlider(options: kendo.ui.SliderOptions): JQuery;
data(key: "kendoSlider"): kendo.ui.Slider;
Expand All @@ -21556,6 +21560,10 @@ interface JQuery {
kendoStockChart(options: kendo.dataviz.ui.StockChartOptions): JQuery;
data(key: "kendoStockChart"): kendo.dataviz.ui.StockChart;

kendoSwitch(): JQuery;
kendoSwitch(options: kendo.ui.SwitchOptions): JQuery;
data(key: "kendoSwitch"): kendo.ui.Switch;

kendoTabStrip(): JQuery;
kendoTabStrip(options: kendo.ui.TabStripOptions): JQuery;
data(key: "kendoTabStrip"): kendo.ui.TabStrip;
Expand Down

0 comments on commit bdb2540

Please sign in to comment.