Yeah all links are the same. Same class and jquery grabs by the class to load it ajax. But I said screw it and just included 'all' into the filterByType function so it will pull it that way.
-----Original Message----- From: John Andersen [mailto:j.andersen...@gmail.com] Sent: October-22-09 7:42 AM To: CakePHP Subject: Re: Is Ajax request How is the HTML looking? Does it look the same as the other links? Enjoy, John On Oct 21, 6:59 pm, "Dave Maharaj :: WidePixels.com" <d...@widepixels.com> wrote: > I have this function where its first called normally by a link (http > request). Once loaded the pagination links are done via Ajax. I have > 'all', 'new', 'archive' links which all get called to paginate the > result using Ajax and jquery. Problem is when i go to posts/index it > works fine, click 'all' which loads index it loads the layout too. The > other links all work fine and load the element except "all" > > function index() { > if ($this->RequestHandler->isAjax()) { > //code for view > $this->layout = 'ajax'; > $this->viewPath = 'elements/posts'; > $this->render(paginate'); > > } > if (!$this->RequestHandler->isAjax()) { > //code for view > $this->layout = 'default_left'; > $this->render('index'); > > } > > } > > so this here will filter the posts depending on what the user clicked > 'all', 'new', 'archive' > But 'all' when clicked always returns the 'default_left' layout > > function filterByType($type = null) { > if ($this->RequestHandler->isAjax()) { > $this->paginate['Post'] = > $this->Post->filterByTypePagination($this->auth_id, $this->rank, > $type, $this->post_display); > $this->set('posts', $this->paginate()); > $this->layout = 'ajax'; > $this->viewPath = 'elements/posts'; > $this->render('paginate'); > } else { > $this->redirect(array('action' => 'index')); > } > } > > Cann someone point out where I am going wrong? I tried if > ($this->RequestHandler->isAjax()) { > //code for view > $this->layout = 'ajax'; > $this->viewPath = 'elements/posts'; > $this->render(paginate'); > > } else { > > //code for view > $this->layout = 'default_left'; > $this->render('index'); > > } > > but same thing keeps happening. > > Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---