Skip to content

Commit a6f05cc

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 82dcf3c commit a6f05cc

File tree

6 files changed

+235
-9
lines changed

6 files changed

+235
-9
lines changed

docs-aspnet-core/getting-started/scaffolding.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ To install the UI for ASP.NET Core Scaffolding templates and extensions in your
6161

6262
![Exclude Templatse folder](images/exclude-templates-from-project-GUI.png)
6363

64+
As of the 2019 R1 release, the `Create New Porject Wizard`, which comes with the Telerik UI for ASP.NET Core [Visual Studio Extensions](https://docs.telerik.com/aspnet-core/vs-integration/introduction), automatically creates the `Templates` folder in the root of the application. For more information on the wizard, refer to the [Creating Projects](https://docs.telerik.com/aspnet-core/vs-integration/new-project-wizard) article.
65+
6466
## Using Scaffolding Templates with Visual Studio
6567

6668
The Kendo UI Scaffolding Templates pertain to `cshtml` generation. That is why, first you have to create the appropriate model and controller as per your application requirements. You can either use the standard Scaffolding or the code you already have. If you do not already have a model and controller, use the sample set below the list to follow the example.

docs-aspnet-core/vs-integration/new-project-wizard.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ As a result, the wizard:
5959
* Copies all Kendo UI editor templates.
6060
* Adds a package reference to the `Telerik.UI.for.AspNet.Core` NuGet package.
6161

62+
As of the 2019 R1 release, the wizard creates a `Templates` folder in the root of the application. By default this folder is not visible and is not included in the project. To make it visible click the `Show All Files` button in the Solution Explorer of Visual Studio.
63+
6264
## See Also
6365

6466
* [VS Integration Overview]({% slug overview_visualstudio_aspnetcore %})

docs/api/javascript/ooxml/workbook.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,28 @@ The date when the workbook is created. The default value is `new Date()`.
6161
});
6262
</script>
6363

64+
### rtl `Boolean` *(default: false)*
65+
66+
Sets the direction of the workbook. By default the direction is left-to-right.
67+
68+
#### Example - set the date
69+
<script>
70+
var workbook = new kendo.ooxml.Workbook({
71+
rtl: true,
72+
sheets: [
73+
{
74+
rows: [
75+
{ cells: [ { value: "foo" } ] }
76+
]
77+
}
78+
]
79+
});
80+
kendo.saveAs({
81+
dataURI: workbook.toDataURL(),
82+
fileName: "Test.xlsx"
83+
});
84+
</script>
85+
6486
### sheets `Array`
6587

6688
The sheets of the workbook. Every sheet represents a page from the final Excel file.

docs/controls/data-management/grid/excel-export.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ For more information on how to use the `background` option to set the background
116116

117117
### Right-to-Left Support
118118

119-
The [`excelExport`](/api/javascript/ui/grid/events/excelexport) event allows reversing the cells and setting the text alignment to support right-to-left (RTL) languages.
119+
The [`excelExport`](/api/javascript/ui/grid/events/excelexport) event allows reversing the cells and setting the text alignment to support right-to-left (RTL) languages. Enable the workbook [`rtl`](/api/javascript/ooxml/workbook/configuration/rtl) option and Excel will show the document in right-to-left flow.
120120

121121
###### Example
122122

@@ -140,9 +140,11 @@ The [`excelExport`](/api/javascript/ui/grid/events/excelexport) event allows rev
140140
pageSize: 7
141141
},
142142
excelExport: function(e) {
143-
var sheet = e.workbook.sheets[0];
143+
var workbook = e.workbook;
144+
var sheet = workbook.sheets[0];
145+
146+
workbook.rtl = true;
144147
for (var i = 0; i < sheet.rows.length; i++) {
145-
sheet.rows[i].cells.reverse();
146148
for (var ci = 0; ci < sheet.rows[i].cells.length; ci++) {
147149
sheet.rows[i].cells[ci].hAlign = "right";
148150
}

docs/controls/diagrams-and-maps/map/how-to/custom-bubble-layer-symbols.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ The following example demonstrates how to render 200-kilometer lines in West-Eas
2828
wraparound: false,
2929
layers: [{
3030
type: "tile",
31-
urlTemplate: "http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
31+
urlTemplate: "https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
3232
subdomains: ["a", "b", "c"],
33-
attribution: "&copy; <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>"
33+
attribution: "&copy; <a href='https://osm.org/copyright'>OpenStreetMap contributors</a>"
3434
}, {
3535
type: "bubble",
3636
attribution: "Population data from Nordpil and UN Population Division.",
3737
dataSource: {
3838
transport: {
3939
read: {
40-
url: "http://runner.telerik.io/fullscreen/EsuDU.json",
40+
url: "https://runner.telerik.io/fullscreen/EsuDU.json",
4141
dataType: "json"
4242
}
4343
}
@@ -52,21 +52,21 @@ The following example demonstrates how to render 200-kilometer lines in West-Eas
5252
5353
// Find locations 100km west and east of center
5454
//
55-
// http://docs.telerik.com/kendo-ui/api/javascript/dataviz/map/location/methods/destination
55+
// https://docs.telerik.com/kendo-ui/api/javascript/dataviz/map/location/methods/destination
5656
//
5757
// Actual distance can be bound to e.dataItem fields
5858
var l1 = location.destination(100000, 270);
5959
var l2 = location.destination(100000, 90);
6060
6161
// View (screen) coordinates for the locations
6262
//
63-
// http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/map/methods/locationToView
63+
// https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/map/methods/locationToView
6464
var p1 = map.locationToView(l1);
6565
var p2 = map.locationToView(l2);
6666
6767
// Draw the lines
6868
//
69-
// http://docs.telerik.com/kendo-ui/api/javascript/dataviz/drawing/circle
69+
// https://docs.telerik.com/kendo-ui/api/javascript/dataviz/drawing/circle
7070
var path = new draw.Path({
7171
stroke: {
7272
width: 2,
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
title: Restrict drag zone for the TreeView
3+
description: An example on how to restrict the drag zone for the Kendo UI TreeView widget.
4+
type: how-to
5+
page_title: Restrict drag zone for the TreeView | Kendo UI TreeView
6+
slug: treeview-restrict-drag-zone
7+
tags: treeview, restrict, drag, zone
8+
res_type: kb
9+
component: treeview
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tr>
16+
<td>Product</td>
17+
<td>Kendo UI TreeView</td>
18+
</tr>
19+
<tr>
20+
<td>Kendo UI version</td>
21+
<td>Created with the 2019.1.115 version</td>
22+
</tr>
23+
</table>
24+
25+
## Description
26+
27+
Presently, the drag zone of the TreeView is on the entire node. It would be nice to have the possibility to specify a dragging element in the node instead.
28+
29+
## Solution
30+
31+
Add a dragFilter option to the TreeView by overriding the implementation of the `_draggable` method.
32+
33+
```dojo
34+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/solid.css">
35+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/fontawesome.css">
36+
37+
<div id="treeview"></div>
38+
39+
<script>
40+
kendo.ui.TreeView.fn.options.dragFilter = null;
41+
42+
kendo.ui.TreeView.fn._dragging = function() {
43+
var enabled = this.options.dragAndDrop;
44+
var dragging = this.dragging;
45+
if (enabled && !dragging) {
46+
var widget = this;
47+
var dragFilter = 'div:not(.k-state-disabled) .k-in';
48+
49+
if (this.options.dragFilter && typeof this.options.dragFilter == 'string')
50+
{
51+
dragFilter = dragFilter + ' ' + this.options.dragFilter;
52+
}
53+
54+
this.dragging = new kendo.ui.HierarchicalDragAndDrop(this.element, {
55+
reorderable: true,
56+
$angular: this.options.$angular,
57+
autoScroll: this.options.autoScroll,
58+
filter: dragFilter,
59+
allowedContainers: '.k-treeview',
60+
itemSelector: '.k-treeview .k-item',
61+
hintText: $.proxy(this._hintText, this),
62+
contains: function (source, destination) {
63+
return $.contains(source, destination);
64+
},
65+
dropHintContainer: function (item) {
66+
return item;
67+
},
68+
itemFromTarget: function (target) {
69+
var item = target.closest('.k-top,.k-mid,.k-bot');
70+
return {
71+
item: item,
72+
content: target.closest('.k-in'),
73+
first: item.hasClass('k-top'),
74+
last: item.hasClass('k-bot')
75+
};
76+
},
77+
dropPositionFrom: function (dropHint) {
78+
return dropHint.prevAll('.k-in').length > 0 ? 'after' : 'before';
79+
},
80+
dragstart: function (source) {
81+
return widget.trigger('dragstart', { sourceNode: source[0] });
82+
},
83+
drag: function (options) {
84+
widget.trigger('drag', {
85+
originalEvent: options.originalEvent,
86+
sourceNode: options.source[0],
87+
dropTarget: options.target[0],
88+
pageY: options.pageY,
89+
pageX: options.pageX,
90+
statusClass: options.status,
91+
setStatusClass: options.setStatus
92+
});
93+
},
94+
drop: function (options) {
95+
var dropTarget = $(options.dropTarget);
96+
var navigationTarget = dropTarget.closest('a');
97+
if (navigationTarget && navigationTarget.attr('href')) {
98+
widget._tempPreventNavigation(navigationTarget);
99+
}
100+
return widget.trigger('drop', {
101+
originalEvent: options.originalEvent,
102+
sourceNode: options.source,
103+
destinationNode: options.destination,
104+
valid: options.valid,
105+
setValid: function (state) {
106+
this.valid = state;
107+
options.setValid(state);
108+
},
109+
dropTarget: options.dropTarget,
110+
dropPosition: options.position
111+
});
112+
},
113+
dragend: function (options) {
114+
var source = options.source;
115+
var destination = options.destination;
116+
var position = options.position;
117+
function triggerDragEnd(source) {
118+
if (widget.options.checkboxes && widget.options.checkboxes.checkChildren) {
119+
widget.updateIndeterminate();
120+
}
121+
widget.trigger('dragend', {
122+
originalEvent: options.originalEvent,
123+
sourceNode: source && source[0],
124+
destinationNode: destination[0],
125+
dropPosition: position
126+
});
127+
}
128+
if (position == 'over') {
129+
widget.append(source, destination, triggerDragEnd);
130+
} else {
131+
if (position == 'before') {
132+
source = widget.insertBefore(source, destination);
133+
} else if (position == 'after') {
134+
source = widget.insertAfter(source, destination);
135+
}
136+
triggerDragEnd(source);
137+
}
138+
}
139+
});
140+
} else if (!enabled && dragging) {
141+
dragging.destroy();
142+
this.dragging = null;
143+
}
144+
};
145+
</script>
146+
147+
<script>
148+
$(function () {
149+
var dataSource = new kendo.data.HierarchicalDataSource({
150+
data: [
151+
{ text: "Furniture", items: [
152+
{ text: "Tables & Chairs" },
153+
{ text: "Sofas" },
154+
{ text: "Occasional Furniture" }
155+
] },
156+
{ text: "Decor", items: [
157+
{ text: "Bed Linen" },
158+
{ text: "Curtains & Blinds" },
159+
{ text: "Carpets" }
160+
] }
161+
]
162+
});
163+
164+
$("#treeview").kendoTreeView({
165+
dataSource: dataSource,
166+
dragAndDrop: true,
167+
dragFilter: ".drag-handler",
168+
template: $('#treeview-item-template').html()
169+
}).data("kendoTreeView")
170+
.templates
171+
.dragClue = kendo.template($('#treeview-drag-clue-template').html());
172+
});
173+
</script>
174+
175+
<script id="treeview-item-template" type="text/x-kendo-template">
176+
<div class="drag-handler"><i class="fa fa-grip-vertical fa-fw"></i></div>
177+
#: item.text #
178+
</script>
179+
180+
<script id="treeview-drag-clue-template" type="text/x-kendo-template">
181+
#: item.text #
182+
</script>
183+
184+
<style>
185+
.k-treeview .k-i-drag-and-drop {
186+
margin-left: 7px;
187+
margin-top: -7px;
188+
width: auto;
189+
height: auto;
190+
}
191+
192+
.drag-handler {
193+
display: inline-block;
194+
color:rgba(0,0,0,.44);
195+
cursor:grab;
196+
}
197+
</style>
198+
```

0 commit comments

Comments
 (0)