Does the css data binding work with kendo buttons?
<button type="button"
aria-label="Thumbs up"
data-role="button"
data-bind="events: { click: thumbsUp }, css:{k-state-active: isThumbsUp}">
<i class="icon-thumbs-up icon-large"></i>
</button>
I have been struggling to understand a data-bind behavior of a dropdownlist control. I bound the source to an observable array of objects (with Text and Field properties). I want to bind the data-text-field to the Text property of the object and data-value-field to the object itself (not to it's Value property).
I tried several options:
Option1:
<select data-role="dropdownlist" data-bind="source: dropDownData, value: selectedValue" data-text-field="Text" data-value-field="this"></select>
SelectedValue is the whole object as a string "[object Object]". Not what I want.
Option2:
<select data-role="dropdownlist" data-bind="source: dropDownData, value: selectedValue" data-text-field="Text" data-value-field="this"></select>
SelectedValue is Text property of the bound object. Not what I want.
Option3:
https://jsfiddle.net/jakubjenis/z1o3L6hd/17
<select data-role="dropdownlist" data-bind="source: dropDownData, value: selectedValue" data-text-field="Text" data-value-field="Value"></select>
Weirdly enough this works. SelectedValue is the whole bound object (with Text and Value properties), but why? This should bind the Value property of the bound object, not the object itself.
Could you please explain what the correct way to set the data-value-field is so that the value field is bound to the whole object?
Thanks,
Jakub
Hi,
To expand on my title a bit, I have a Upload widget which doesnt allow multiple files, and validates that uploaded documents are pdf's under 4Mb.
The problem is that when a new file is uploaded to replace the existing one, the Upload widget will make a call to delete the existing document, ONLY THEN will it validate the new one. How can I trigger the validation before the delete? This would prevent my users from inadvertently deleting the previous document, if the new one is not valid.
Thanks,
Grant
Background
I have a Kendo autocomplete that should display a list of "recently searches" on focus. To accomplish this, I wired up a focus event, where I autocomplete.search(''). This reliably displays the default list (whole list on local datasource and whatever my server returns on empty string with a remote datasource). However, we also wish to enable the suggest option, so upon focus, the autocomplete empty searches, and suggests the first option.
IE 11 Issue
This is where the first issue occurs. On IE11, our first search is triggered, and does as anticipated (shows list, and suggests the first option). However, a second search is also fired, but uses the suggestion as the search criteria.
This can be demonstrated in an isolated Dojo: https://dojo.telerik.com/ekIXopar by selecting the autocomplete input.
All Browsers Issue - Search Triggered by Modifier Keys
On all browsers, even non-IE11, pressing modifer keys (eg: ctrl, shift, caps-lock, etc...) will immediately trigger a search with whatever is in the textbox (including suggestions). This causes issues when combined with the suggest is true. The real-world use case for this was having our users go to paste in something:
1. The focus search and suggest fills in the textbox with the first search result
2. The user presses ctrl in preparation to ctrl-v paste.
3. Between ctrl and v, the autocomplete will trigger another search with the now suggested text as criteria, thus narrowing the result to only the 1, AND offsetting the selection by 1 at the start of the text (ie: all but the first letter is highlighted).
4. When the user finishes the paste, the result is the first letter of the original suggestion and whatever they pasted.
This can also be demonstrated in the above dojo. Simply select the input and press and release the ctrl button. You should immediately see the first character get unselected, and "Albania" should become the only auto-suggestion result.
Possible Causes
Digging into the Kendo AutoComplete source, the keydown listener is picking up the control key as it's own keydown. From here, we have some if/elses that perform certain logic such as moving the selection up/down. However, our example of ctrl (keycode 17), falls into the else logic, which triggers a search based on the input value.
Possible Solutions
1. If I put the focus listener before the autocomplete call, I remove the initial issue... however, the fundamental issue with modifier keys triggering searches remains. This is problematic as pressing control (and other modifier keys), imho, shouldn't directly change the user's search results.
2. Add additional listeners to filter our these keys before the kendo autocomplete init, and stop the events from getting to kendo (stopImmediatePropagation). May introduce some other issues...
Question
Is there a solution to the IE11 bug? And for modifier searches, is there better work-arounds, or is this something that Kendo could address in an update?
Hello Telerik/Kendo People,
I have been noticing a certain lag in my application's responsiveness and using Chrome's developer tools to debug, I found out that the JS calls are being slowed with the following verbose console logs:
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
jquery-1.12.3.js:4932
The relevant SO question pointing to this is in this link:
Given jQuery is still in the implementation of a fix for this issue through their library, I wonder what Kendo recommends as a workaround for this issue.
Thanks.
Hello
Are there any plans for annotation layer?
Thank you
Jeff