I'm writing a form using Zend_Dojo_Form
.
Everything goes fine, unless I dynamically insert elements into the form (using ajax, the user can add more elements by clicking a [+] button).
I managed to insert my new Zend_Dojo_Form_Element_FilteringSelect
into the page, but the element isn't dojo-enabled (no auto-completion, or tundra styling).
I'm guessing dojo transforms existing form elements once the page is loaded the first time, and doesn't parse them again when a new node is added... But I can't find how to tell dojo there's new elements in town.
What I've tried:
- Executing
dojo.parser.parse();
ordojo.parser.parse('id_of_new_element');
after the insertion of a new element - Adding
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
in my Dojo_Form's init() method (as seen on nabble's forums)
My method for adding new elements is the one described by Jeremy Kendall.
I don't know if my problem comes from an incompatibility with Zend, Dojo, or if I'm missing something...