我有一个带有dojo 1.5 的表单设置。我正在使用 dijit.form.ComboBox 和 dijit.form.TextBox
Combobox 具有诸如“car”、“bike”、“motorcycle”之类的值,并且文本框是 Combobox 的形容词。因此,Combobox 中的内容并不重要,但如果 ComboBox 确实具有值,则必须在 TextBox 中填充某些内容。或者,如果 ComboBox 中没有任何内容,则 TextBox 中也没有任何内容,这很好。事实上,如果 Combobox 中没有任何内容,那么文本框中必须没有任何内容。
在常规编码中,我只会在文本框上使用 onBlur 事件来转到检查 ComboBox 是否有值的函数。我在dojo中看到这不起作用...代码示例如下...
Vehicle:
<input dojoType="dijit.form.ComboBox"
store="xvarStore"
value=""
searchAttr="name"
name="vehicle_1"
id="vehicle_1"
/>
Descriptor:
<input type="text"
dojoType="dijit.form.TextBox"
value=""
class=lighttext
style="width:350px;height:19px"
id="filter_value_1"
name="filter_value_1"
/>
我最初的尝试是在描述符的 <input> 标记中添加一个 onBlur,但发现这不起作用。
Dojo 是如何处理这个问题的?是通过 dojo.connect 参数吗?即使在上面的示例中,组合框的 id 为“vehicle_1”,文本框的 id 为“filter_value_1”,也可以有许多组合框和文本框,它们按顺序向上编号。(vehicle_2、vehicle_3 等)
任何建议或资源链接将不胜感激。