Load a view with Ajax and Zend - issues

Hello :),

I’m trying to understand and make this thing to work here. No success so far.


class EquipasController extends OccControllerAction{

	protected $_flashMessenger = null;

	public function init(){
        $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
        $this->view->action = $this->_request->getActionName();
        $this->view->controller = $this->_request->getControllerName();

       if ($this->getRequest()->isXMLHttpRequest()) {
            $this->_helper->layout->disableLayout();
       }
}

 public function listaAction() {
        echo ("I'm HERE??");
} 

}

I have this on my default defined view for Equipas controller:


<a href="<?php echo $this->url(array("controller"=>"equipas","action"=>"lista"), null, true); ?>" class="ajaxloader">Mostra Lista Sff</a>
<div id="testresults">
    <h1>I would love that something appears here when I click...</h1>
</div>

And below on that same view, the corresponding javascript:


$(function() {
        $('.ajaxloader').click(function(event) {
            var target = $(this).attr('href');
            window.location.hash = target;
            $.ajax({
                  url: target,
                  success: function(data) {
                    $('#testresults').html(data);
                  }
                });
            return false;
        });
    });

When I click the link, I get the all page inside #testresults , and NO data displayed. (that’s because I believe I’m passing none) BUT, I don’t get the echo of my controller on the viewport neither…

Last 5 hours lost here…

X.X
Márcio

Should I provide more details?
Can you guess if this could be due some prior configurations on ZF ? (could that be the case?)
Does the code provided seemed ok and, for that, anyone find a reason for given the error, so the error must rely on something else?

Please, any clue will be important. :slight_smile:

K. Regards,
Márcio

I was not allowing my Action to be used on Acl.php .

Dummy me.

Regards,
Márcio