Matthew Weier O'Phinney-3 wrote:
> 
> You can pass a "form" key to the XHR call, and point it to the form's
> DOM node. If you're using Zend_Dojo_Form (and thus dijit.form.Form),
> you'll need to do this:
> 
>     form: dijit.byId("<your form ID here>").domNode,
> 
> This will send all form elements as key/value pairs in the request.
> 

That sounds like a good option - I don't seem to need it now, but will have
it in mind when needed (with the Zend_Dojo_Form soon :)


Matthew Weier O'Phinney-3 wrote:
> 
> Dojo is highly modular, which makes it easy to debug, maintain, and
> understand. The downfall, of course, is lots of micro requests. The
> upside is that Dojo provides a build tool that allows you to compile all
> these files into a single file, complete with comment stripping,
> whitespace removal, and more. I've blogged about it as well as presented
> on the topic... and will have an article in an upcoming issue of
> php|architect covering it as well.
> 
My Prototype library was probably compiled like that. I'm looking forward to
your article!

Matthew Ratzloff wrote:
> 
> I don't use Dojo, but from what I understand this might be helpful:
> http://dojotoolkit.org/book/dojo-book-0-4/part-6-customizing-dojo-builds-better-performance/dojo-build-system/creating-cust
> 
Thank you also to Matthew Ratzloff for pointing me in that direction!


Matthew Weier O'Phinney-3 wrote:
> 
>> I have some follow-up questions:
>> How can I get the response back from the action in my controller and
>> 'cancel' all other aggregated content in the view? Do I have to use
>> contextSwitch action helper somehow, or am I on the wrong track?
>> Embarrasing: for now I do an *ugly* die($content) to just abort and echo
>> the
>> data back.
> 
> Disable the layout and the view renderer. If you use ContextSwitch or
> AjaxContext helpers, this is done automatically.
> 
I tried these, but didn't find a way to let them accept the partial
('_my_partial.phtml') without a special suffix  like in
'_my_partial.ajax.phtml' that I already use in my view and that I want to
keep the same. So I went with the following (borrowing from AjaxContext):

// ... in controller:
if ($this->getRequest()->isXmlHttpRequest()) {
    $this->_helper->layout()->disableLayout();
    $viewRenderer =
Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
    $viewRenderer->setNoRender(true);
    
    // send response now
    echo $this->view->partial(
        '_my_partial.phtml',
        array(
            'var1' => 'value1',
            'var2' => 'value2',
        )
    );
    // stop processing
    exit;
}

After I send the response back to the calling view, I don't want any further
processing happening, or? Is there a better way to echo/exit?

Thanks for all your help!
-- 
View this message in context: 
http://www.nabble.com/Zend_Dojo-vs-Prototype-tp20757810p20822127.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to