Skip to content

Commit 320a1a2

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent ffdd879 commit 320a1a2

File tree

2 files changed

+16
-39
lines changed

2 files changed

+16
-39
lines changed

docs/api/javascript/ui/upload.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,8 @@ Removes all files for which the callback function returns `true` by sending a st
12401240

12411241
> The invoking of the `removeFile` method does not trigger the `remove` event.
12421242
1243+
> In a chunk upload scenario the method will not work for files that are not fully uploaded and saved. To remove a file that has been canceled call the `remove` handler manually.
1244+
12431245
#### Example
12441246

12451247
<input name="files" id="files" type="file" />
@@ -1390,6 +1392,8 @@ Fires when the upload was cancelled while in progress.
13901392

13911393
> The `cancel` event fires only when the Upload is in [async mode](/web/upload/modes#asynchronous-mode).
13921394
1395+
> To remove the data of a file that has been canceled, manually call the `remove` handler. For more information refer to the limitation of the [`removeFile` method](/api/javascript/ui/upload/methods/removefile)
1396+
13931397
#### Example
13941398

13951399
<input type="file" name="files" id="photos" />

docs/knowledge-base/combobox-highlight-matched-text.md

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,24 @@ Implement the `dataBound` event handler for the widget.
4343
var items = combo.items();
4444
var inputText = $('.k-input').val().toLowerCase();
4545
46-
for (var i = 0; i < items.length; i += 1) {
46+
for (var i = 0; i < items.length; i += 1) {
4747
var item = $(items[i]);
4848
var itemHtml = item.html();
4949
var startIndex = itemHtml.toLowerCase().indexOf(inputText);
50-
if(startIndex>=0){ // Only highlighted the items which contain the search text
51-
var endIndex = startIndex + inputText.length;
52-
var outputHtml = [
53-
itemHtml.slice(0, startIndex),
54-
'<span class="highlight">',
55-
itemHtml.slice(startIndex, endIndex),
56-
'</span>',
57-
itemHtml.slice(endIndex)
58-
].join('');
59-
60-
item.html(outputHtml);
61-
}
62-
}
63-
}
50+
var endIndex = startIndex + inputText.length;
6451
65-
// Remove highlight after seleting the event. Otherwise dropdown always highlighted the item which has been selected frist time after searching text.
66-
function removeHighlight(e) {
67-
var combo = e.sender;
68-
var items = combo.items();
69-
var inputText = $('.k-input').val().toLowerCase();
70-
71-
for (var i = 0; i < items.length; i += 1) {
72-
var item = $(items[i]);
73-
var itemHtml = item.html();
74-
var startIndex = itemHtml.toLowerCase().indexOf(inputText);
75-
if (startIndex > 0) {
76-
if (item.find('span.highlight').length > 0) {
77-
var itemText = item.text();
78-
item.html(itemText);
79-
}
80-
}
52+
var outputHtml = [
53+
itemHtml.slice(0, startIndex),
54+
'<span class="highlight">',
55+
itemHtml.slice(startIndex, endIndex),
56+
'</span>',
57+
itemHtml.slice(endIndex)
58+
].join('');
59+
60+
item.html(outputHtml);
8161
}
8262
}
83-
63+
8464
$(document).ready(function() {
8565
$("#products").kendoComboBox({
8666
placeholder: "Select product",
@@ -97,13 +77,6 @@ Implement the `dataBound` event handler for the widget.
9777
url: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products",
9878
}
9979
}
100-
},
101-
select: function (e) {
102-
var item = e.dataItem;
103-
// This checking is required. issue in kendo dropdown : the select event is triggered on blur, although it is not needed
104-
if (item !== null) {
105-
removeHighlight(e);
106-
}
10780
}
10881
});
10982
});

0 commit comments

Comments
 (0)