I have a dropdownlist control that I want to set a specific value after it is done binding.
It appears that the items collection is empty after bindingComplete. I was able to produce this on the JSFiddle demo site.
When I run the below code the getItems method returns zero.
Let’s say I want the drop down to default to “Breve” but I don’t know the index. What do I do? Thank you.
var source = [
“Affogato”,
“Americano”,
“Bicerin”,
“Breve”,
“Café Bombón”,
“Café au lait”,
“Caffé Corretto”,
“Café Crema”,
“Caffé Latte”];
$(“#jqxDropDownList”).on(‘bindingComplete’, function (event) {
alert($(“#jqxDropDownList”).jqxDropDownList(‘getItems’).length);
});
// Create a jqxDropDownList
$(“#jqxDropDownList”).jqxDropDownList({
source: source,
theme: ‘energyblue’,
width: ‘200px’,
height: ’25px’,
selectedIndex: 3,
checkboxes: true
});