Skip to content

Commit a0cc307

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 14b5dda commit a0cc307

File tree

14 files changed

+704
-615
lines changed

14 files changed

+704
-615
lines changed
Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
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 by using the Telerik UI Create New Project Wizard. To get started with the Wizard, refer to the article on [creating projects]({% slug newprojectwizards_visualstudio_aspnetcore %}).
16-
17-
## Sample Applications
18-
19-
The sample Razor Pages samples which demonstrate the usage of the Telerik UI for ASP.NET Core components are located in the [ASP.NET Core Examples](https://github.com/telerik/ui-for-aspnet-core-examples) repository on GitHub.
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 %})
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 by using the Telerik UI Create New Project Wizard. To get started with the Wizard, refer to the article on [creating projects]({% slug newprojectwizards_visualstudio_aspnetcore %}).
16+
17+
## Sample Applications
18+
19+
The sample Razor Pages samples which demonstrate the usage of the Telerik UI for ASP.NET Core components are located in the [ASP.NET Core Examples](https://github.com/telerik/ui-for-aspnet-core-examples) repository on GitHub.
20+
21+
## Known Limitations
22+
23+
Razor Pages use `Page` in their routing mechanism which interferes with `GET` requests made by the Kendo UI DataSource. As a result, only `POST` requests should be used when paging is required.
24+
25+
## See Also
26+
27+
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects]({% slug gettingstarted_aspnetmvc6_aspnetmvc %})
28+
* [Get Started with Telerik UI for ASP.NET Core in ASP.NET Core Projects with the CLI]({% slug gettingstartedcli_aspnetmvc6_aspnetmvc %})
29+
* [Known Issues with Telerik UI for ASP.NET Core]({% slug knownissues_aspnetmvc6_aspnetmvc %})
30+
* [Tag Helpers for ASP.NET Core]({% slug taghelpers_aspnetmvc6_aspnetmvc %})
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: How to add a click handler to an icon in the ListBox template
3+
description: How do I add a small icon to the listbox items that would launch a window?
4+
type: how-to
5+
page_title: How to add a click handler to an item in a draggable ListBox
6+
slug: listbox-add-click-handler-to-item-template
7+
position:
8+
tags: listbox, click, icon, template, function, click not working, draggable
9+
ticketid: 1401928
10+
res_type: kb
11+
---
12+
13+
## Environment
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td>Product Version</td>
18+
<td>2019.1.220</td>
19+
</tr>
20+
<tr>
21+
<td>Product</td>
22+
<td>jQuery Kendo UI ListBox and wrappers</td>
23+
</tr>
24+
</tbody>
25+
</table>
26+
27+
## Description
28+
29+
I would like to add a small icon to the template of the Kendo UI ListBox that is clickable. No matter what I try the function is not executed.
30+
31+
## Solution
32+
33+
The Kendo UI ListBox prevents the `mousedown` event as it needs it for dragging and selection. To be able to attach a handler that responds to an external mouse event, you can wrap the list box in another div and check for the target element during `mousedown` or `click`.
34+
35+
```tab-jQuery
36+
<div id="listbox-container">
37+
<select id="listBox"></select>
38+
</div>
39+
40+
<script>
41+
// the item template has an icon with class see-more
42+
$("#listbox-container").on("click", ".see-more", function(e){
43+
var dataItem = listbox.dataItem($(e.target).closest(".k-item"));
44+
kendo.alert("Children: " + kendo.stringify(dataItem.children));
45+
});
46+
</script>
47+
```
48+
```tab-Razor
49+
<div id="lb">
50+
@(Html.Kendo().ListBox()
51+
.Name("listBoxAvailableRoles")
52+
.TemplateId("customer-item-template")
53+
)
54+
</div>
55+
<script id="customer-item-template" type="text/x-kendo-template">
56+
<span class="k-icon k-i-edit edit"></span>
57+
<span class="k-state-default"><p>#: data.Name #</p></span>
58+
</script>
59+
<script>
60+
$("#lb").on("mousedown", ".edit", function (e) {
61+
kendo.alert("test");
62+
});
63+
</script>
64+
```
65+
66+
###### Example
67+
68+
```dojo
69+
<script type="text/kendo-x-tmpl" id="template">
70+
<span class="k-icon k-i-eye see-more"></span>
71+
<span class="k-state-default"><div>#: data.name #</div></span>
72+
</script>
73+
<div id="listbox-container">
74+
<select id="listBox"></select>
75+
</div>
76+
<script>
77+
var listbox = $("#listBox").kendoListBox({
78+
draggable:true,
79+
dataSource: {
80+
data: [
81+
{ name: "Jane Doe", children: [{name: "Mary"}] },
82+
{ name: "John Doe", children: [{name: "Tom"}, {name: "George"}] }
83+
]
84+
},
85+
template: kendo.template($("#template").html())
86+
}).data("kendoListBox");
87+
88+
$("#listbox-container").on("click", ".see-more", function(e){
89+
var dataItem = listbox.dataItem($(e.target).closest(".k-item"));
90+
kendo.alert("Children: " + kendo.stringify(dataItem.children));
91+
});
92+
93+
</script>
94+
<style>
95+
.see-more {
96+
color: #515967;
97+
background-color: #f3f3f4;
98+
padding:4px;
99+
border-radius:5px;
100+
border: 1px solid #515967;
101+
}
102+
</style>
103+
```

src/kendo.menu.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,10 @@ var __meta__ = { // jshint ignore:line
831831

832832
if (item.length || candidate === this.element){
833833
return item;
834+
} else if (overflowWrapper) {
835+
return overflowWrapper.find(candidate);
834836
} else {
835-
return overflowWrapper && overflowWrapper.find(candidate);
837+
return $();
836838
}
837839
},
838840

src/kendo.notification.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ var __meta__ = { // jshint ignore:line
215215
origin: that._popupOrigin,
216216
position: that._popupPosition,
217217
animation: options.animation,
218+
copyAnchorStyles: false,
218219
modal: true,
219220
collision: "",
220221
isRtl: that._isRtl,
@@ -236,11 +237,11 @@ var __meta__ = { // jshint ignore:line
236237
popup.open();
237238
} else {
238239
if (x === null) {
239-
x = $(window).width() - wrapper.width() - options.position.right;
240+
x = $(window).width() - wrapper.outerWidth() - options.position.right;
240241
}
241242

242243
if (y === null) {
243-
y = $(window).height() - wrapper.height() - options.position.bottom;
244+
y = $(window).height() - wrapper.outerHeight() - options.position.bottom;
244245
}
245246

246247
popup.open(x, y);
@@ -375,6 +376,7 @@ var __meta__ = { // jshint ignore:line
375376
wrapper
376377
.addClass(KNOTIFICATION + "-" + type)
377378
.toggleClass(KNOTIFICATION + "-button", options.button)
379+
.toggleClass(KNOTIFICATION + "-closable", options.button)
378380
.attr("data-role", "alert")
379381
.css({width: options.width, height: options.height})
380382
.append(that._getCompiled(type, safe)(args));
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
// Notification
2-
3-
.k-notification-wrap
4-
{
2+
.k-notification {
53
padding: .6em .5em;
4+
border-width: 1px;
5+
border-style: solid;
66
cursor: default;
77
position: relative;
88
white-space: nowrap;
9-
}
9+
box-sizing: border-box;
1010

11-
.k-notification-button .k-notification-wrap
12-
{
13-
padding-right: 20px;
11+
&-closable {
12+
padding-right: 20px;
13+
}
1414
}
1515

1616
.k-notification-wrap > .k-i-information,
1717
.k-notification-wrap > .k-i-information,
1818
.k-notification-wrap > .k-i-information,
1919
.k-notification-wrap > .k-i-warning,
20-
.k-notification-wrap > .k-i-information
21-
{
20+
.k-notification-wrap > .k-i-information {
2221
vertical-align: text-bottom;
2322
margin-right: 4px;
2423
}
2524

26-
.k-notification-wrap > .k-i-close
27-
{
25+
.k-notification-wrap > .k-i-close {
2826
position: absolute;
29-
top: 7px;
27+
top: 50%;
3028
right: 4px;
29+
transform: translateY(-50%);
3130
display: none;
3231
}
3332

34-
.k-notification-button .k-notification-wrap > .k-i-close
35-
{
33+
.k-notification-closable .k-notification-wrap > .k-i-close {
3634
display: block;
3735
}

styles/web/common/scheduler.less

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -950,11 +950,7 @@ div[name="recurrenceRule"] > .k-dropdown
950950
{
951951
display: block;
952952
border-width:1px;
953-
}
954-
955-
.k-rtl .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view {
956-
text-align: left;
957-
padding-left: 1em;
953+
text-align: right;
958954
}
959955

960956
.k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view > .k-link

styles/web/kendo.common-fiori.less

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,10 @@ span.k-tooltip
741741
}
742742
}
743743

744-
.k-notification-wrap {
744+
.k-notification {
745745
padding: 1.786em;
746746
}
747747

748-
.k-notification-wrap > .k-i-close {
749-
top: 21px;
750-
}
751-
752748
.k-slider-track {
753749
border-width: 0;
754750
}

styles/web/kendo.common-material.less

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,10 @@ div.editorToolbarWindow.k-window-content {
855855
}
856856
}
857857

858-
.k-notification-wrap {
858+
.k-notification {
859859
padding: 1.786em;
860860
}
861861

862-
.k-notification-wrap > .k-i-close {
863-
top: 21px;
864-
}
865-
866862
.k-slider-track {
867863
border-width: 0;
868864
}

styles/web/kendo.common-nova.less

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ div.editorToolbarWindow.k-window-content {
844844
height: 3.458em;
845845
}
846846

847-
.k-notification-wrap {
847+
.k-notification {
848848
padding: 1.786em;
849849
}
850850

@@ -856,10 +856,6 @@ div.editorToolbarWindow.k-window-content {
856856
}
857857
}
858858

859-
.k-notification-wrap > .k-i-close {
860-
top: 21px;
861-
}
862-
863859
.k-slider-track {
864860
border-width: 0;
865861
}

styles/web/kendo.common-office365.less

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,8 @@
285285
padding: 0 6px;
286286
}
287287

288-
.k-notification-wrap {
288+
.k-notification {
289289
padding: 1.75em;
290-
291-
> .k-i-close {
292-
top: 50%;
293-
transform: translateY(-50%);
294-
}
295-
}
296-
297-
.k-notification-time {
298-
padding: 1.250em;
299290
}
300291

301292
.k-numerictextbox .k-link .k-i-arrow-60-up {

0 commit comments

Comments
 (0)