开发者

How can I dynamically add a Zend_Dojo form element to a zend_form?

开发者 https://www.devze.com 2022-12-17 03:12 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号