How do I access "DATA-" attributes in a option after converting the select to a kendo dropdownlist?
Here is an example of my select:
<select id='connect-search-results'>
<option data-text='Text-One' data-id='Data-One' data-url='\\One'>One</option>
<option data-text='Text-Two' data-id='Data-Two' data-url='\\Two'>Two</option>
</select>
I was using:
var $option = $('#connect-search-results option:selected');
if ($option.length > 0) {
var id = $option.data('id');
var url = $option.data('url');
var text = $option.data('text');
...
}
but now that I've converted the select to a dropdownlist, the jquery calls are failing to return the data.
Here is an example of my select:
<select id='connect-search-results'>
<option data-text='Text-One' data-id='Data-One' data-url='\\One'>One</option>
<option data-text='Text-Two' data-id='Data-Two' data-url='\\Two'>Two</option>
</select>
I was using:
var $option = $('#connect-search-results option:selected');
if ($option.length > 0) {
var id = $option.data('id');
var url = $option.data('url');
var text = $option.data('text');
...
}
but now that I've converted the select to a dropdownlist, the jquery calls are failing to return the data.