Question

I need additional information associated to the selected item. how do I access to the additional fields at change event

var language = [
        {value: "English",  culture: "en-US", direction: "ltr", text: "English"},
        {value: "עברית",    culture: "he-IL", direction: "rtl", text: "עברית - Hebrew"},
        {value: "Français", culture: "fr-FR", direction: "ltr", text: "Français - French"}
    ];

$('#input').kendoDropDownList({
    'dataTextField': 'text',
    'dataValueField': 'value',
    'dataSource': language,
    'index': 0,
    'change': function (e) {
        // how do I access here to 'culture' and 'direction' fields
    }
});
Was it helpful?

Solution

You can use the dataItem method of the widget to retrieve the data for the selected item:

'change': function (e) {
    var item = this.dataItem();
    // item.culture and item.direction
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top