Skip to content

Commit 0752b51

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 492927f commit 0752b51

File tree

7 files changed

+203
-5
lines changed

7 files changed

+203
-5
lines changed

docs/api/javascript/ui/grid.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,9 +3471,9 @@ If set to `true` the grid will export all pages of data. By default the grid exp
34713471
});
34723472
</script>
34733473

3474-
### excel.fileName `String` *(default: "Export.xslx")*
3474+
### excel.fileName `String` *(default: "Export.xlsx")*
34753475

3476-
Specifies the file name of the exported Excel file.
3476+
Specifies the file name of the exported Excel file. Must end with ".xlsx".
34773477

34783478
#### Example - set the default Excel file name
34793479

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Always Show Marker Tooltip
3+
description: How to have labels on the map markers by utilizing their tooltips
4+
type: how-to
5+
page_title: Always show marker tooltips like labels | Kendo UI Map
6+
slug: map-marker-labels-from-always-shown-tooltips
7+
position:
8+
tags: map,show,always,marker,tooltip,label
9+
ticketid: 1412666
10+
res_type: kb
11+
---
12+
13+
## Environment
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td>Product</td>
18+
<td>Map for Progress® Kendo UI®</td>
19+
</tr>
20+
</tbody>
21+
</table>
22+
23+
24+
## Description
25+
The map markers have tooltips the user can show by hovering with the mouse. In some cases, you may want them to show up automatically when the map loads.
26+
27+
To do this, you need to loop the markers, and call the .show() method of their tooltips. You can do this after the map initializes and in its [events](https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/map#events).
28+
29+
## Solution
30+
```dojo
31+
<div id="map"></div>
32+
33+
<script>
34+
function createMap() {
35+
var map = $("#map").kendoMap({
36+
center: [30.268107, -97.744821],
37+
zoom: 3,
38+
layers: [{
39+
type: "tile",
40+
urlTemplate: "http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
41+
subdomains: ["a", "b", "c"],
42+
attribution: "&copy; <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>"
43+
}],
44+
markerDefaults: { //make tooltips "sticky" by default
45+
tooltip: {
46+
autoHide: false
47+
}
48+
},
49+
markers: [{
50+
location: [30.268107, -97.744821],
51+
shape: "pinTarget",
52+
tooltip: {
53+
content: "Austin, TX"
54+
}
55+
}, {
56+
location: [40.7128, -74.0060],
57+
shape: "pinTarget",
58+
tooltip: {
59+
content: "New York, NY"
60+
}
61+
}],
62+
zoomEnd: function (e) { //when the user zooms or pans, re-show the tooltips
63+
showTooltips(e.sender);
64+
},
65+
panEnd: function (e) {
66+
showTooltips(e.sender);
67+
}
68+
}).data("kendoMap");
69+
return map;
70+
}
71+
72+
$(document).ready(function () {
73+
var map = createMap();
74+
showTooltips(map); //show the tooltips initially
75+
});
76+
77+
function showTooltips(map) {
78+
setTimeout(function () {
79+
var extent = map.extent(); //we use this to only show tooltips for markers that are visible
80+
for (var i = 0; i < map.markers.items.length; i++) {
81+
if (extent.contains(map.markers.items[i].options.location)) {
82+
map.markers.items[i].tooltip.show();//show the tooltips
83+
}
84+
}
85+
}, 500); //kinetic scrolling and loading new content can cause concurrency issues if no timeout is present. You can test smaller values if you like, though
86+
}
87+
</script>
88+
89+
<style>
90+
/* remove the manual close button from the tooltips so the user can't dismiss them and the are more like labels */
91+
92+
div.k-tooltip-button {
93+
display: none;
94+
}
95+
96+
div.k-tooltip div.k-tooltip-content {
97+
padding-right: 0;
98+
}
99+
</style>
100+
```
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: Preview Export API in PDF Viewer
3+
description: How to preview the generated PDF from the Kendo Drawing API in PDV Viewer
4+
type: how-to
5+
page_title: Using PDF Viewer with PDF Export API | Kendo UI PDF Viewer and Export API for jQuery
6+
slug: preview-pdf-export-api-in-viewer
7+
position:
8+
tags: pdf,viewer,export,preview,api,generate,download
9+
ticketid: 1412617
10+
res_type: kb
11+
---
12+
13+
## Environment
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td>Product Version</td>
18+
<td>2019.2.619</td>
19+
</tr>
20+
<tr>
21+
<td>Product</td>
22+
<td>PDFViewer for Progress® Kendo UI®</td>
23+
</tr>
24+
</tbody>
25+
</table>
26+
27+
28+
## Description
29+
Sometimes, you may want to show your users the PDF that the [Kendo Drawing API](https://demos.telerik.com/kendo-ui/pdf-export/index) will generate, instead of having them download it.
30+
31+
You can do this by combining the Drawing API with the [PDF Viewer component](https://demos.telerik.com/kendo-ui/pdfviewer/index).
32+
33+
## Solution
34+
Generate the PDF as usual through the ` kendo.drawing.drawDOM()` method, and when the promise is resolved, in the `done` method, use the [fromFile method](https://docs.telerik.com/kendo-ui/api/javascript/ui/pdfviewer/methods/fromfile) of the PDF viewer component, instead of `kendo.saveAs`.
35+
36+
```dojo
37+
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.js"></script>
38+
<script>
39+
window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
40+
</script>
41+
42+
<div class="content-wrapper">
43+
<input type="text" placeholder="Type your name" />
44+
<input type="text" placeholder="Type your comment" />
45+
</div>
46+
<br/>
47+
<button id="export-pdf">make the pdf</button>
48+
<br/>
49+
<br/>
50+
51+
52+
<div id="pdfViewer">
53+
</div>
54+
55+
56+
<script>
57+
var viewer = $("#pdfViewer").kendoPDFViewer({
58+
pdfjsProcessing: {
59+
file: ""
60+
},
61+
width: "100%",
62+
height: 500
63+
}).getKendoPDFViewer();
64+
65+
$("#export-pdf").click(function() {
66+
// Convert the DOM element to a drawing using kendo.drawing.drawDOM
67+
kendo.drawing.drawDOM($(".content-wrapper"))
68+
.then(function(group) {
69+
// Render the result as a PDF file
70+
return kendo.drawing.exportPDF(group, {
71+
paperSize: "auto",
72+
margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
73+
});
74+
})
75+
.done(function(data) {
76+
viewer.fromFile({ data: data.split(',')[1] }) //for versions prior to R2 2019 SP1, use window.atob(data.split(',')[1])
77+
});
78+
});
79+
</script>
80+
```
81+

src/kendo.responsivepanel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var __meta__ = { // jshint ignore:line
1515
var NS = ".kendoResponsivePanel";
1616
var OPEN = "open";
1717
var CLOSE = "close";
18-
var ACTIVATE_EVENTS = "click" + NS +" touchstart" + NS;
18+
var ACTIVATE_EVENTS = "click" + NS +" touchstart" + NS + " touchend" + NS;
1919
var Widget = kendo.ui.Widget;
2020
var ResponsivePanel = Widget.extend({
2121
init: function(element, options) {
@@ -109,6 +109,10 @@ var __meta__ = { // jshint ignore:line
109109
_toggleButtonClick: function(e) {
110110
e.preventDefault();
111111

112+
if(e.type == "touchend") {
113+
return;
114+
}
115+
112116
if (this.element.hasClass("k-rpanel-expanded")) {
113117
this.close();
114118
} else {

src/kendo.virtuallist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ var __meta__ = { // jshint ignore:line
13381338

13391339
if (listType === "group") {
13401340
if (item) {
1341-
newGroup = index === 0 || (this._currentGroup && this._currentGroup !== item.group);
1341+
newGroup = index === 0 || (this._currentGroup !== false && this._currentGroup !== item.group);
13421342
this._currentGroup = item.group;
13431343
}
13441344

@@ -1387,7 +1387,7 @@ var __meta__ = { // jshint ignore:line
13871387
item;
13881388

13891389
this._view = {};
1390-
this._currentGroup = null;
1390+
this._currentGroup = false;
13911391

13921392
for (var i = index, length = index + itemCount; i < length; i++) {
13931393
item = this._itemMapper(this.getter(i, index), i, value);

styles/web/common/responsivepanel.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@
5252
overflow: visible !important;
5353
}
5454
}
55+
56+
.k-rpanel-toggle {
57+
touch-action: manipulation;
58+
}

tests/responsivepanel/initialization.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,14 @@
148148

149149
assert.isOk(dom.hasClass("k-rpanel-expanded"));
150150
});
151+
152+
it("touchend event is prevented", function() {
153+
new ResponsivePanel(dom);
154+
var button = $("<button class='k-rpanel-toggle' />").appendTo(Mocha.fixture);
155+
156+
button.trigger('touchend');
157+
158+
assert.isOk(!dom.hasClass("k-rpanel-expanded"));
159+
});
151160
});
152161
}());

0 commit comments

Comments
 (0)