Question

I'm working on a web application that I didn't make myself and it has been done using Dojo and specially Dijit. The part which I'm struggling with is about a form that gets changed depending on radio buttons. Therefore, I'm using dijit.byId('id').setAttribute('disabled',true); to disabled a field and this works on FF but not with IE8. Although, it works but not directly when I check the radio button, I have to do one more action (like clicking in a random area on the page) and the action is applied. I tried with stuff like: document.getElementById('id').disabled=true; but it doesn't work correctly either.

Would you please have any suggestion? Thank you.

Was it helpful?

Solution

Dojo Widgets have a convention to set attributes using the set method.

dijit.byId('id').set('disabled',true);

This convention will call the _setDisabledAttr method on the widget which will take care of making itself disabled.

http://dojotoolkit.org/reference-guide/1.7/dijit/_WidgetBase.html#attributes

OTHER TIPS

We had nearly the same Problem as you do.

Try dijit.registry to get or set attributes for disabled or enabled.

We had the problem with a query that tested whether one or the other radio button was active. Then another record should be read at a time. Unfortunately this did not work with dojo.byId so we looked for a solution and found it as described above in dijit.registry.

Here's the link:http://dojotoolkit.org/reference-guide/1.9/dijit/registry.html#dijit-registry

Hope it might help you.

Regards, Miriam

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top