cakephp - Pagination through ajax and showing post on the same page -
i new cakephp, , m stuck thing. code working need modification in code. when try paginate view through different pages works each page fetch 20 posts only, see next posts change page. 1st 20 post in view , on click of button using ajax want show next 20 post on same page (i don't want redirct pages see comment) plz help...
this action call show view of different pages.
public function view($slug) { $topic = $this->topic->getbyslug($slug); $user_id = $this->auth->user('id'); $post_count = $topic['topic']['post_count']; $this->paginate['post']['conditions'] = array('post.topic_id' => $topic['topic']['id']); if ($this->requesthandler->isrss()) { $this->set('posts', $this->paginate('post')); $this->set('topic', $topic); return; } if (!empty($this->request->data['poll']['option'])) { $this->topic->poll->vote($topic['poll']['id'], $this->request->data['poll']['option'], $user_id); $this->topic->deletecache(array('topic::getbyslug', $slug)); $this->redirect(array('plugin' => 'forum', 'controller' => 'topics', 'action' => 'view', $slug)); } $this->forumtoolbar->markasread($topic['topic']['id']); $this->topic->increaseviews($topic['topic']['id']); $this->forumtoolbar->pagetitle($topic['topic']['title']); $this->set('topic', $topic); $this->set('posts', $this->paginate('post')); $this->render('view_new'); }
i looking ajax pagination few time ago.
after long search found solution, have posted @ link mentioned below.
Comments
Post a Comment