$("#autocomplete").data("kendoAutoComplete").bind("dataBound", function(event) {
$(this).bind('dblclick', function(event) {
// how to access the item ID of the item which was clicked?
});
});
7 Answers, 1 is accepted
Hello Hendrik,
When the list is opened, it is closed on click, so there is no way to bind to the double click event, for the popup. You can bind the dblclick event to the input that will show the value, and get the item through the AutoComplete dataItem method.
Regards,Kiril Nikolov
Telerik
I think you mean something like this?
Any suggestions?
var ac = $("#autocomplete").data("kendoAutoComplete");
var acList = ac.list
acList.bind("dblclick", "{extraEvent: ac}", function(event) {
// how to access the item ID of the autocomplete list item which was clicked?
console.log(event.data.extraEvent);
});
bb
Hello Hendrik,
I have created an example that shows a possible implementation:
Here is a screencast showing this in action:
http://screencast.com/t/7rLSu2o8Iy
Regards,Kiril Nikolov
Telerik
Hello Hendrik,
I have attached the sample as a .zip file.
Regards,Kiril Nikolov
Telerik
(I'm preventing the default close behaviour of the suggestion popup)
Hello Hendrik,
As I said this is not supported and currently cannot be achieved. The suggestion is just a workaround that you can decide whether will work for you or not. As for the double click on the popup - You can submit this as a feature request on UserVoice. So it will be considered for a future implementation.
Regards,Kiril Nikolov
Telerik