I would like to upgrade a web app I am working on from v2.1 to v3.1 of the Javascript API (I have tried 3.2 but I am getting some very odd rending problems, so I'm settling with 3.1 for now...) One issue I have encountered is that a ComboBox populated with a store does not seem to fully function with 3.1. I was told I can fix this by replacing the ComboBox with a FIlteringSelect widget, but so far I haven't succeeded. Below is my code. I was hoping I wouldn't need to do much more than replace the ComboBox object with the FilteringSelect object, but that apparently isn't sufficient. Can somebody help me see what I am missing? Thanks, Jason
JS (old code:)
function populateSchoolMenu(results)
{
var schoolName;
var values = [];
var testVals = {};
var features = results.features;
dojo.forEach(features, function (feature) {
if ( (schoolLayerFlag == 0) || (schoolLayerFlag == 2) )
{
schoolName = feature.attributes.Name;
}
else if (schoolLayerFlag == 1)
{
schoolName = feature.attributes.Site_name;
}
if (!testVals[schoolName])
{
testVals[schoolName] = true;
values.push({ name: schoolName });
}
});
var dataItems = {
identifier: 'name',
label: 'name',
items: values
};
var menuStore = new dojo.data.ItemFileReadStore({ data: dataItems });
dijit.byId("schoolMenu").store = menuStore;
}
HTML (old:)
<select id = "schoolMenu"
dojotype="dijit.form.ComboBox"
value = "Select School"
autoComplete="true" class="comboBoxClass"
forceValidOption="false"
onchange="executeSelectedQuery(this)">
</select>