Reputation: 8568
I am using kendo-knockoutjs library. I have a kendo dropdownlist. I am trying to implement a tooltip on it, so that when the mouse is over some element of the dropdown, a message with the title
value to be shown:
html:
<div>
<input type="text" data-bind="kendoDropDownList: {data: myData, value: myValue}" />
</div>
javascript:
var myViewModel = function () {
this.myData = ['test1', 'test2', 'test3'];
this.myValue = ko.observable();
this.title = 'This is a comment for' + this.myValue();
}
ko.applyBindings(new myViewModel());
I found something similar here:
http://jsfiddle.net/valchev/eLnqs/1/
but I am not sure how to implement it in my scenario. I don't think I want taking reference to the widget in my viewmodel. Also when I pass databound
option in my bindings and trying to call a function the bindings are broken
data-bind="kendoDropDownList: { data: SubMenuTypesOptions, value: SubMenuType, enabled: isEditable, dataBound: testFunction }"
Upvotes: 0
Views: 1279
Reputation: 2176
here is how you might do it without taking reference in data bound but using template option
<div>
<input type="text" data-bind="kendoDropDownList: {data: myData, value: myValue,template:'<span title=\'${data}\'>${data}</span>',dataBound:testFunction}" />
</div>
also dataBound works...
Upvotes: 1