jQuery/Ajax with Zend Framework

Posted by Nathan on Stack Overflow See other posts from Stack Overflow or by Nathan
Published on 2009-11-11T22:56:09Z Indexed on 2010/04/10 4:03 UTC
Read the original article Hit count: 458

Filed under:
|

I've been tinkering around with Zend-Framework and Jquery for a month or so, and finally started tinkering with them together using ZendX_JQuery. It seems I've ran into something that at first seemed it should be simple, So maybe I'm just missing something here.

I have a view along the lines of:

$this->ajaxLink( $this->escape($var->title),
                 $this->baseUrl() . "/another/action",
                 array('update' => '#domain' . $var->id ,                      
                	   'complete' => '$("#domain' . $var->id .'").toggle("slow");'));

echo '<div id="domain"' . $var->id . '" style="display:none;" ></div>';

Which works correctly, when the link displayed by the code above is clicked it loads the contents returned from /another/action into the domain"id" div. The problem occurs when the view loaded by the above contains an ajaxLink() the ajax link stops working. This can be fixed by adding an option to the ajaxLink() array "inline" => true but what if I need other JQuery views helpers to work when loaded into the page via ajax i.e. dialogContainer()

I guess I could simply be asking how to control where zendx jquery helper puts java script. by default it is trying to put all statments in the <head> section in a single <script> tag. I need away around that for views displayed from an ajax call. Does Dojo try and force all php rendered javascript/ajax into the head also?

Thanks.

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about jQuery