在Codeigniter的一页上进行多次分页的最佳方法 [英] Best way to do multiple pagination on one page in codeigniter

查看:62
本文介绍了在Codeigniter的一页上进行多次分页的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于堆栈溢出,我已经看到许多有关此主题的老文章,但似乎都没有给出任何清晰的解释.通过了解他们,我了解到Codeigniter不通过其类支持多个分页,而您必须编写自己的类.

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.

我想知道是不是这种情况.如果这里有人对如何操作有任何想法,请告诉我.我有三个要传递给视图的列表.但是,当我对它们全部进行分页时,所有三个列表对同一页面偏移量的响应.是Ajax_pagination的出路吗?

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.

更新:这是我的代码以及我要执行的操作.这是一个查看文件.我有两个列表1. org_list 2. Ind_list 我正在尝试将两个视图文件(organization_listing,individual_listing)中的这两个列表传递给此视图文件,因此它们都显示在同一页面上.现在我可以对一个列表进行分页,但是当我对第二个文件进行分页时,它们都响应相同的uri偏移量.

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.

我正在(organization_listing,individual_listing)视图文件中生成分页链接.

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);?>

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

推荐答案

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

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.

这篇关于在Codeigniter的一页上进行多次分页的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆