I have a dhtmlXCombo box that is populated after an ajax call, but I can’t initialize it. It’s always empty.
after the ajax call this code is run
//my select list this.resourceTypeCtrl
this.PopulateDropdownList(this.resourceTypeCtrl, data.resourceTypes);
var myCombo = dhtmlXComboFromSelect("gantt-filter-resource-types");
and here is the PopulateDropdownList function
PopulateDropdownList(dropdown, options) {
for (var i = 0; i < options.length; ++i) {
var opt = options[i];
var el = document.createElement("option");
el.textContent = opt.name;
el.value = opt.id;
dropdown.appendChild(el);
};
}
The Select list is being populated, however when I try to convert it to dhtmlx combo it does not populate. That is from an existing select.
I have also tried with a DIV
var myCombo = new dhtmlXCombo("gantt-filter-resource-types");
for (let i = 0; i < data.resourceTypes.length; i++) {
myCombo.addOption(data.resourceTypes[i].id, data.resourceTypes[i].name, null);
}
[/code]
This also doesn’t work.