Cakephp Ajax Pagination Cakephp Ajax pagination works same like normal pagination , the difference is that it load the pages without refreshing Controller index function public function index(){ $this->paginate = array('limit'=>5,'order'=>'User.id desc'); $userDetail = $this->paginate('User'); $this->set('userDetail',$userDetail); if($this->RequestHandler->isAjax()){ // check the type of request $this->layout = ''; $this->autoRender = false; $this->render('index'); // render the same view } } User index view // script to load page by ajax <script> $(document).ready(function(){ $(".pagination a, .header a").on('click',function(){ $('#content').load(unescape($(this).attr("href")),function(){ }); return false; }); }); </script> <div id="content"> // show the ...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.