开发者

dojo filteringselect with option value '0'

i have following filteringselect:

<select name="v" dojoType="dijit.form.FilteringSelect" valueList="v" id="v" value="0"><option value=""></option><option value="0">0-test</option><option value="1">1-test2/option><option value="2">2-test3</option><option value="X">X-testx</option></select> 

the strange thing is, that the empty option is selected by default allthough i set the开发者_开发知识库 value to '0'.

does anybody know this phenomenon? regards, gerhard


The browser is defaulting selectedIndex=0 since you did not specify any option tag as selected originally. This gives the widget 2 different initial values: 1) value="0" and 2) selectedIndex=0. However, in this corner case, value == selectedIndex, which tells the widget to ignore value since some browsers set value=selectedIndex by default on select tags.


fixed it! - it seems that when using filteringselects with inlined options, the option has to be marked as selected too.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜