I am using CakePHP since last 5 years, and am quite used to of “AjaxHelper” for developing Ajax features using CakePHP. But from version 1.3 CakePHP has started deprecating the “AjaxHelper” replacing it with new “JsHelper”, which can be used with many JS libraries.
While AjaxHelper is still there for people like me. There is at least one big change that I noticed just now. It is related with working of Ajax Pagination.
Now the “Paginator” helper by default uses “JsHelper”, for generating the Javascript links. Now if you are trying to avoid using JQuery then you need some way to tell the “Paginator” helper to use “AjaxHelper” instead of JsHelper. Although the CakePHP documentation mentions that you can set the default helper value to Ajax Helper using following code, but it does not worked for me.
$this->set('posts', $this->paginate());
//Add this line below above line
$this->helpers['Paginator'] = array('ajax' => 'Ajax');
I tried it several times changing values and variables but no success.
Instead of above you can use following two lines in the view file to tell the “Paginator”, to use Ajax helper.
$this->Paginator->_ajaxHelperClass = "Ajax";
$this->Paginator->Ajax = $this->Ajax;
$this->Paginator->options(array("update" => "",'evalScripts' => true));
You also do NOT need to add the line
echo $this->Js->writeBuffer();
at the end of view file.
Search the site
Popular posts
- Working with Access-Control-Allow-Origin
- Connecting Sony K750 with Windows 7
- Updating Nokia E72 phone software
- Javascript code to convert date to timestamp
- Installing Skype on Fedora 14
- Using AjaxHelper for pagination in CakePHP 1.3
- Apache Keep Alive Directive
- Setting include path for a domain in Plesk
- Displaying UTF characters in the FPDF
- Merge the remote changes before pushing again : Git Message
Random Testimonial
- ~ Elance ID – catchlight
"This was a seemingly small job, but a very important one and one that needed to be done right. A certain level of knoowledge is required for this type of task and nirvaat carried it out beautyifully. Nice work and I'd reccommend this provider to anyone working with"
- Read more testimonials »
What's the little bird saying?
- New post: Fix Error 0×80070424 on windows http://t.co/bmK0AZpH 169 days ago
- New post: Configuring Horder Vacation Responder in Plesk 9 http://t.co/gcsPNIVv 192 days ago
- New post: Wordpress update issue on Plesk http://t.co/dUxcjpgR 198 days ago
- I’ve just taken the WordPress 2012 User and Developer Survey, have you? http://t.co/G20SmrMr (pass it on!) 224 days ago
- New post: Mobile device emulators to test web page display http://t.co/jmgc0x99 234 days ago

October 13, 2010 in
thanks for nice idea…….