Currently I can add a Zend Form element dynamically to a form after it is first loaded. 开发者_JAVA技巧 I do this through a mouse click and some ajax. However, I want to add the exact same element with a different name (basically I am giving each element an id). However, when I add the field it just shows up like a normal field and isn't Dojo'fied.
Dojo Form elements have to be initialized. This usually happens when the page is served to the browser when the DOM is ready. Dojo will parse the page and startup the form elements. When you get the elements through Ajax or create them dynamically, you have to startup the new elements again. I remember this to be somewhat tricky though.
See these related questions:
- Cannot create dijits via dojo.NodeList.instantiate
- DOJO : How do you reinitiate form elements after ajax call?
- dojo.parser.parse only working first time it's called
- http://www.dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/dijit-parse-after-ajax-call-again
精彩评论