> Where can I find a turorial/article?
Dunno. I don't use the JS Helpers. But, if you're using JQuery, it's
pretty simple.
$('#some_identifier li a').click(function(e)
{
var the_link = $(this);
$.ajax({
url: the_link.attr('href'),
success: function(response)
{
// ACTION
}
});
});
If you want to use JS to simply remove the LI, ACTION would be, eg:
the_link.parent('li').remove();
If, instead, your PHP method re-fetches the $elements and passes a new
UL back to the browser:
the_link.parent('ul').replace(response);
In the latter case, what I would do is create an element that's
normally included into the view. Then, in the PHP AJAX method:
$this->set(compact('elements'));
$this->viewPath = 'elements/some_name';
$this->render('element_name');
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment