Shared Know How


Howto: fix, find, use, make & do it guide

Archive for June, 2009

Solved Dojo> Dijit.Dialog in ZendFrameWork doesn’t parse

author Posted by: Tim on date Jun 8th, 2009 | filed Filed under: php, programming

When trying to make a Dojo dialog work with another controller which is loaded trough the href attribute of the dialog. The content will not render as dijit elements.

This is because ZendFramework places all the properties in the Javascript array zendDijits and then add them to the elements after loading. However this will not work for the loaded Dialog because the ZendDijits are set in the view of the controller opening the dialog.

The simple solution to this is to use the declaritive formin the Zend_Dojo_View_Helper_Dojo by placing the following line in your code:

  1.  
  2. Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
  3.  

I placed this in my bootstrap.php right after the line where the Zend_Dojo_View_Helper is loaded.

Making de view helper declarative will place the dojo properties directly into the html of the elements.
Side-effect: the script will not be correctly verified as valid (x)html but it will solve the problem!