views:

399

answers:

1

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.

A: 

Yes Dojo works in the same fashion. There should be methods on the Container to get the actual functions so you can render them where you like though. Not sure what they are as I havent used the ZendX_Jquery package yet.

prodigitalson
Thanks for your reply, I may go back and look closer at how Dojo integrates with zend framework and how it would work in this instance. I kinda over stepped it and went straight to the ZendX_Jquery package.
Nathan