Thursday, September 27, 2012

Ajax paging in cake php


Controller Code :-
     
       $this->set('products', $this->paginate('Product', $condition));
      if ($this->request->is('ajax')) {
            //Configure:write('debug', 0);
            $this->layout = '';
            $this->viewPath = 'Elements' . DS . 'admin/products';
            $this->render('index');
        }

.ctp code :-


            <?php
echo $this->Javascript->link('jquery-1.4.2.min');

        $this->Paginator->_ajaxHelperClass = "Ajax";
           $this->Paginator->Ajax = $this->Ajax;
        $this->Paginator->options(array('update'=>'listID',
                    'url'=>array('controller'=>'users','action'=>'index',$separator),
                    'indicator' =>'loaderID'));
        $ascImage = $this->Html->image('sort_up.gif',array('border'=>0));
        $descImage = $this->Html->image('sort_down.gif',array('border'=>0));
?>
  

--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: