AnsweredAssumed Answered

Adding values to dijit/form/ComboBox

Question asked by margaraiz on Aug 29, 2016
Latest reply on Aug 30, 2016 by rscheitlin

Hello!

 

I am learning wab and dojo and trying to load some values in a combo box that is defined in the widget.html:

 

widget.html:

           <select data-dojo-type="dijit/form/ComboBox" id="listcity" name="citycombo"> </select>

 

widget.js:

              node = dojo.byId("listcity");

 

              var elOptNew = document.createElement('option');
              elOptNew.text = "city1";
              elOptNew.value = 1;

 

              node.add(elOptNew);

 

              elOptNew = document.createElement('option');
              elOptNew.text = "city2";
              elOptNew.value = 2;

 

              node.add(elOptNew);

 

This works fine for me, but I think that there are other ways with the stores to do the same.. Any help?

 

Thanks in advance!

Marga

Outcomes