开发者

How to change the displayed Value to one of the available options in a dijit.form.ComboBox?

I have a dijit.form.ComboBox defined declaratively:

<select dojoType="dijit.form.ComboBox" id="mycb">
  <option value="A">Alpha</option>
  <option value="B">Beta</option>
  <option value="C">Charl开发者_Go百科ie</option>
</select>

When using

dijit.byId("mycb").set("value","B");

the displayed Content changes to "B" and not to "Beta".

What am I doing wrong handling the ComboBox?


My mistake was using a "dijit.form.ComboBox" in place of a Element.

A dijit.form.ComboBox behaves like a html element wich gives a number of options to choose from.

The element that corresponds to a is "dijit.form.FilteringSelect". Using this dijit, the above method will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜