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);?>
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);?>
Share Improve this question edited Jun 22, 2012 at 15:46 yash asked Jun 22, 2012 at 10:49 yashyash 1833 silver badges12 bronze badges 2- Can you give an example of exactly what you are trying to achieve? – MikeCruz13 Commented Jun 22, 2012 at 12:41
- If you do not like ajax ... you can use iframes. – csotelo Commented Jun 22, 2012 at 14:41
2 Answers
Reset to default 1If you want
1 2 3 4
results
1 2 3 4
results
I'm fairly certain it's pretty straight forward:
- just configure for the first set (say to use uri segment 3)
- Initialize the pagination
- Create the links; and
- Send it to the view.
Then
- Configure for the second set (say to use uri segment 4)
- Initialize the pagination
- Create the links; and
- Send it to the view.
Guys I have finally used javascript to load my individual paginations into the page, so I'm sending my paginations into three different views and then using javascript to call those views into the page. Couldnt figure out any way to do multiple paginations on the same page.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745260008a4619168.html
评论列表(0条)