I have two comboboxes. First in primary page works (shows multiple items and behaves correctly).
The second comboboxes is on a dialog loaded from the same page. It has the same data but it only shows a single value in the type-in field and there are other items.
I wrote a little helper function to setup the comboboxes. Here it is:
function initCombo(id, data) {
var source = {
"datatype": "json",
"root": "query",
"datafields": [
{ "name": "label" },
{ "name": "value" },
{ "name": "selected" }
],
"localdata": data
};
var adapter = new $.jqx.dataAdapter(source);
$(id).jqxComboBox({ source: adapter, displayMember: 'label', valueMember: 'value', theme: 'billmax' }).css('display', 'inline-block');
for(i = 0; i < data.query.length; i++) {
if(data.query[i].selected) {
$(id).jqxComboBox({selectedIndex: i });
}
}
The usage:
var taxregions = ##Ftaxregions#;
initCombo("#accountTaxregion", taxregions);
The ##Ftext# bit is a placeholder for our forms program. On load it is replaced with json data from the server.
Can anyone think of a reason for this? How do I debug this? I’ve tried everything but nothing makes a difference.