Question

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?

Was it helpful?

Solution

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>

OTHER TIPS

<span data-dojo-type="dijit.InlineEditBox" data-dojo-props="onChange:function(){ applyChange(arguments[0]);}" width="70px" title="Admin Notes">Database Value</span>
<script>
function applyChange(newValue){
    console.log(newValue);
}
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top