I have an ajax->autoComplete working dandy with cakePHP. Now I want to add my own javascript (preferably callback methods) after the request has been executed. I know that there are options associated with the ajaxHelper but I cannot figure out for the life of me how to apply them to the autoComplete function.
I can get ajax->autoComplete('div', 'url', array('with'=> 'console.log("hello")')) to execute BEFORE anything happens the very first time, but none of the other options linked to above work (I think because ‘with’ puts the javascript directly in the address, so obviously it will execute). I have also read the autoComplete API and googled around for a bit, but can’t find any examples or documentation of how to apply options.
You are correct, there are AJAX options. And then, there’s this:
http://api.cakephp.org/view_source/ajax-helper/#line-129
You can use any of those options in the “options” array.