AJAX helper
The AjaxHelper utilizes the ever-popular jQuery and jQuery UI libraries for Ajax operations and client side effects. To use the AjaxHelper, you must have a current version of the JavaScript libraries from jQuery download page and jQuery UI download page. In addition, you must include the jQuery and jQuery UI JavaScript libraries in any layouts or views that require AjaxHelper functionality.
This Helper is replacement for orginal CakePHP AjaxHelper, but it's not fully compatible with orginal Helper. Most of differences can be found in $options parameter (because of using other library).
2010-03-18 04:37:19
¡que bueno que se cuente con Jquery es este frame work! Se que a muchos les agradara. saludos
2010-03-18 14:42:09
Hi,
Just by fast checking the source code it seams like this class requires PHP 5 and won't be working as expected with PHP 4 (due to the constructors), isn't that a bit weird since CakePHP only have stable versions for PHP 4+ ?
Regards
Tobias
2010-03-18 19:23:00
I've checked your helper and found that $this->RequestHandler->isAjax() in controller returns false, if use default contentType. I don't see any reason why this happens...
2010-03-18 20:01:26
Oops, sorry. It was Security component that was the cause. Don't look at my previous post.
2010-03-18 20:07:59
Tobias: this constructor is used in cakePHP core. So I think that it'll work with PHP 4+
2010-03-24 04:14:06
Thank you very much for your efforts. I appreciate it. Will test it soon. Again , thx. Greetings from Germany
2010-03-26 14:16:06
Pretty nice! Just what I wanted.
maybe this helper becomes standard in a year.
2010-03-29 06:48:40
I have seen this helper methods and documentation, but still didnt use........ I am sure from its docs that will be great helper for Ajax lovers in cakephp
2010-04-01 06:35:13
thx, really nice work
2010-04-06 13:06:53
Nice Work.Pls i am having an issue. when using the link, its generating Event.observe which is a prototype event. Pls how do handle this issue. I am using the latest stable version of cakephp.Thanks
2010-04-06 15:51:41
Pls i sincerely apologize for the multiple submissions, my internet speed was very slow and i kept refreshing not knowing that it was submitting to your site. Pls i accept my apologies....still expecting your reply. Thanks
2010-04-06 20:41:06
nice work
2010-04-07 10:28:35
David U:
You should place javascript.php in your helpers directory.
2010-04-07 10:54:29
kvas thanks a million. It worked! Great Job...Do have a great day
2010-04-09 07:36:14
Hi I am trying to upload file using ajax form but it is not working.
2010-04-09 17:34:23
Abdul: You need other helper for ajax file uploading.
This helper, like base Ajax Helper, is not including this feature.
2010-04-10 22:15:53
Thank you for your great effort and i will test it :)
2010-04-13 00:05:30
Works great, many thanks ;]
2010-04-16 19:53:14
Muchas Gracias por este helper, es maravilloso, hace rato estaba buscando algo asi.
Eternamente agradecido
2010-04-17 23:18:40
Very nice helper!
Thanks!
2010-04-20 10:49:10
Finaly! That is , what i need! Thanks!
2010-04-23 11:13:36
Great helper...
2010-05-12 09:34:34
Hello,
I am having a problem. i want to update/add row to table but my response contains <html tags. i only want <td elements i have tried setting layout=NULL but not working.
any help
2010-05-12 09:53:46
well i have checked the response. it contains what i am looking for but while updating it is removing td elements :/ I am updating <tr> element on form submit
2010-05-13 08:44:20
khan:
You can try:
$this->layout = 'ajax';
ajax layout should placed in app/view/layouts/ (it is placed here at default).
2010-05-17 16:11:25
Hi kvas,
I'm using your helper (it's excelent).
So, i am with problems to use it in Google Chrome. An error message appears on every ajax request:
XML cannot be read [CORE/cake/libs/xml.php, line 883]
But the ajax works. I read that the problem is solved setting the request header type (request.setRequestHeader( ‘Content-type’, ‘text/plain’);”;).
How can I fix it in your helper?
2010-05-17 18:06:36
Hi Geidivan J.!
You can try additional option named 'contentType'...
Example:
<?php echo $ajax->link(
'View Post',
array( 'controller' => 'ajax', 'action' => 'view', 1 ),
array( 'update' => 'post', 'contentType' => 'text/plain')
);
?>
I'll glad if you write if this helped. BTW. I'm not getting this error in my chrome :/
2010-05-17 19:33:42
Thanks kvas, it worked perfectly (your answers are fast).
2010-05-18 06:15:44
Hi there,
What is the proper call to check if ajax is being used in my controller? I tried isAjax() as well as $this->requestHanlder->isAjax() and neither seem to work.
Thanks!
2010-05-18 09:04:34
Hi Eric!
I'm using
$this->params['isAjax']
and it's working for me :)
2010-05-21 06:35:26
That worked! Thanks!
2010-05-26 23:03:42
Gracias por el aporte
2010-05-27 14:39:53
Hi. I have a button when the user click on the button, the ajax call a method. This method, return a array and each elements must be set in differents text fields. How can i do it?
thanks.
2010-05-31 16:11:31
Thanks a lot, kvas!
I did not believe my eyes when I saw this actually working. I have had too much pain getting Prototype, Script.aculo.us & jQuery working nicely together, but this is a real solution. And a fast one too (much faster auto complete!). All my auto complete fields, ajax forms and such worked straight away!
2010-06-08 13:02:48
i m new to cakephp ......... i have problem with image uploading ... i used ajax helper, in comments i read about ajax file uploading helper , can you please give me link for ajax file uploading helper or little bit description about ajax file uploading helper...thanks .
2010-06-08 14:48:40
vinay, you can try with http://www.davidgolding.net/cakephp/ajax-file-uploading-with-cake-and-jquery.html
2010-07-01 13:53:22
hi...
Thanks a Lot ....
i update my jquery with jquery 1.2.2 as instruction given in link , it works but i got error in js file
f.offset is undefined
jquery-ui-1.8rc3.custom.min.js
2010-07-05 10:13:20
vinay , you should use more actual version than 1.2.2 (like 1.4.2)...
I didn't ever get this error, so I can't help you at this moment...
2010-07-06 15:48:25
Hi,
How can I change the charset of the ajax requests? I'm using de remoteTimer with 'contentType' => 'text/plain' but I would like to change the charset.
thanks.
2010-07-07 09:32:37
Hi Kvas, I was wondering if you can still use Prototype and script.aculo.us even after adding the jquery helper?
Thanks!
2010-07-16 10:27:10
Geidivan, I think that jQuery doesn't provide this feature. You can build callback method that will converse from one charset to the other.
Louie Miranda, no at this moment jQuery is not installed in compatibile mode...
2010-08-15 05:14:02
Hi Kvas,
I've been using your helper, fantastic stuff. Thank you!
Quick question, is there any way at all to support file upload? I notice you only allow "post" or "get" as form types currently.
Thanks! And any way I can help out with this project, let me know.
Eric
2010-08-15 23:13:59
Hi Eric,
I didn't try try to upload files by this helper yet, so at this moment I think it's not posibble :)
Maybe in future I'll add support for those features...
2010-08-16 05:49:42
Kvas,
I'm interested in helping you develop this functionality. Let me know when you are available to discuss. I've sent you my email via your contact form.
Thanks!
Eric
2010-08-29 14:05:20
Dobra robota, dzięki wielkie!