This is a migrated thread and some comments may be shown as answers.

Retrieve Currently Selected OBJECT (Not Text)

1 Answer 233 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 31 Jan 2012, 03:18 PM
I know that, using the .value(); method I can retrieve the TEXT of the currently selected item ...but what if we want to get the entire object, with all of its existential data intact?

Currently, the only method I have found is the following ...

var combobox = $("#input").data("kendoComboBox");
console.log(combobox.dataSource.view()[combobox._current.index()]);


This seems hardly intuitive and excessively redundant. The code is relatively simple, can't we just get a simple .selected() or a .current() method attached to it that pulls this? 

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 01 Feb 2012, 11:09 AM
Hello Derek,

 
Currently the widget has current() method which returns the current selected LI element. For now you will need to use the aforementioned approach to get the data item. I will foward your request to our developers for further consideration. I will suggest you open a thread in Kendo UI User Voice. Thus the people can vote for this feature.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ComboBox
Asked by
Derek
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or