5

I have seen a number of old posts around this topic on stack overflow but none of them seem to give any clarity. What I have understood by going through them is that codeigniter doesnt support multiple paginations through its class and that you have to write your own class.

I wonder if that is the case. In case any body here has an idea about how to do it please let me know. I have three lists which I'm passing into the view. However when I paginate all of them, all the three lists response to same page offset. Is Ajax_pagination the way out?

Please suggest how to do this.

UPDATE: Here is my code and what I'm trying to do.This is a view file. I have two lists 1. org_list 2. Ind_list I'm trying to pass to these two lists in tow view files (organization_listing, individual_listing) both of which are loaded in this view file and therefore appear on the same page. Now I can paginate one list but when I paginate the second file they both respond to same uri offset.

I'm generating the pagination links in the (organization_listing, individual_listing) view files.

<?php 

    $config['base_url'] = 'http://localhost/socialinew/user_registration/index.php/members_area/view_members_area';
    $config['total_rows'] = count($org_list);
    $config['per_page'] = 4;
    $config['num_links'] = 20;
    $config['full_tag_open'] = '<div id="pagination3">';
    $config['full_tag_close'] = '</div>';

    $this->pagination->initialize($config);

    for($i=$this->uri->segment(3)+0;$i<(($this->uri->segment(3)+$config['per_page']));$i++)
    {
        if(isset($org_list[$i]))
        {$temp_org[$i]=$org_list[$i];
        }


    }

    $tmp_org['org_list']=$temp_org;


$this->load->view('organization/organization_listing',$tmp_org);



    $org_config['base_url'] = 'http://localhost/socialinew/user_registration/index.php/members_area/view_members_area/';
    $org_config['total_rows'] = count($ind_list);
    $org_config['per_page'] = 5;
    $org_config['num_links'] = 20;
    $org_config['full_tag_open'] = '<div id="pagination2">';
    $org_config['full_tag_close'] = '</div>';

    $this->pagination->initialize($org_config);

    for($i=$this->uri->segment(4)+0;$i<(($this->uri->segment(4)+$config['per_page']));$i++)
    {
        if(isset($ind_list[$i]))
        {$temp_ind[$i]=$ind_list[$i];
        }
    }

        $tmp_ind['ind_list']= $temp_ind;    

$this->load->view('individual_listing',$tmp_ind);?>

4

2 回答 2

1

伙计们,我终于使用 javascript 将我的个人分页加载到页面中,所以我将我的分页发送到三个不同的视图中,然后使用 javascript 将这些视图调用到页面中。无法找出在同一页面上进行多个分页的任何方法。

于 2012-07-24T10:24:44.903 回答
1

If you want

1 2 3 4

 results

1 2 3 4

 results

I'm fairly certain it's pretty straight forward:

  1. just configure for the first set (say to use uri segment 3)
  2. Initialize the pagination
  3. Create the links; and
  4. Send it to the view.

Then

  1. Configure for the second set (say to use uri segment 4)
  2. Initialize the pagination
  3. Create the links; and
  4. Send it to the view.
于 2012-06-22T13:27:01.003 回答