Wednesday, November 7, 2012

Cakephp Basic Ajax Pagination

 <div id="ajaxview">   
      <table>   
           <tr class="paging">   
                <th><?php echo $this->Paginator->sort('name');?></th>   
           </tr>   
           <tr>   
                <td><?php echo $data['Data']['name'];?></td>   
           </tr>   
      </table>   
      <div class="paginga">   
           <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>   
           |<?php echo $this->Paginator->numbers();?>   
           |<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>   
      </div>   
      <script type="text/javascript">   
           $(document).ready(function(){   
                $(".paginga").click(function(){   
                     $("#ajaxview").load(this.href);   
                     return false;   
                })   
           });   
      </script>   
 </div>  

No comments:

Post a Comment