Dojo:获取OnChange上的inlineEditBox的ID [英] Dojo: Get ID of inlineEditBox on OnChange
本文介绍了Dojo:获取OnChange上的inlineEditBox的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望键值成为inlineEditBox小部件的ID。如何以编程方式访问?
解决方案
由于InlineEditBox是一个小部件,因此最好不要监视DOM级别的事件。相反,为什么不连接到InlineEditBox.onChange?例如:
< span dojoType =dijit.InlineEditBox...>
< script type =dojo / connectevent =onChangeargs =value>
console.log(this.id +更改为值+值);
< / script>
< / span>
I'm using dojo and dijit and have an inlineEditBox widget. I'm trying to capture the onchange event and send a key/value post to a php page (to set into a database). The value is the new value just submitted, available from e.target.value. That's easy.
I'd like the key value to be the id of the inlineEditBox widget. How can I access that programatically?
解决方案
Since InlineEditBox is a widget it's best not to monitor DOM level events. Instead, why not connect to InlineEditBox.onChange? For example:
<span dojoType="dijit.InlineEditBox" ...>
<script type="dojo/connect" event="onChange" args="value">
console.log(this.id + " changed to value" + value);
</script>
</span>
这篇关于Dojo:获取OnChange上的inlineEditBox的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文