dojo dijit.InlineEditBox script type='dojo/connect' throws an error sometimes need to suppress

147 Views Asked by At

So I have a html page which has snippets like this

<span dojoType='dijit.InlineEditBox' editor='dijit.form.Textarea' id='actionDetails13' value='Leave admit source entered during Express Registration' autoSave='false' noValueIndicator='[Details]'>  
<script type='dojo/connect' event='onChange' args='value'>  
</script>  
</span> 

This works just fine in chrome and IE however when the page is very large only internet explorer throws an error

DOM Exception: NOT_FOUND_ERR (8)

and those particular inlineeditbox will no longer appear. So perhaps of 1,000 inlineedit boxes 70% will render.

If I comment out the script type='dojo/connect' then no errors are thrown.

I think it is probably some limit of IE but any ideas what is causing this?

2

There are 2 best solutions below

0
On

Maybe it's the way you connect the onClick-event.

Try it like:

<script type="dojo/on" data-dojo-event="click">
    on(registry.byId("button1"), "click", function(){
    console.log("I was clicked!");
    });
</script>

Regards, Miriam

0
On

I suggest use the code below. It works for me.

require([
         "dojo/dom-attr",
         "dojo/on",
         "dojo/domReady!"
         ], function ( domAttr,on) {

           var actionDetails13 = dojo.byId("actionDetails13");

           var handle = on(actionDetails13 , "change", customFunction);

           function customFunction() {
                var actionDetails13Value= domAttr.get("actionDetails13", "value"); 
                //your code
           };
        });

Ref:

https://dojotoolkit.org/reference-guide/1.9/dojo/connect.html

https://dojotoolkit.org/reference-guide/1.9/dojo/dom-attr.html