this is a simple question, but one that I have not been able to find an answer to online, or here on stackoverflow. How do I attach another function to a Js event call. This is what I have and should give some context:
$this->Js->get('#all-matches');
$this->Js->event(
'click',
$this->Js->request(
array('action' => 'findMatches', 'all'),
array('async' => true,
'update' => '#matches',
'success' => $this->Js->each('$(#event-matches).addClass("active");'))
I essentially want to change a classname on a div element to ‘active’ after the ajax call. Seems like this should be a no-brainer but I cant find any documentation on it.
Thanks!
The Js helper is limited in feature. Can’t really expect a simple php wrapper to generate all types of js code you need. Sooner or later you will find it getting in your way rather than helping you code faster as you have done now. It’s best to just directly write jquery code yourself (or any other js lib of your choice).