Welcome Guest, Not a member yet? Register   Sign In
Pagination Link Issue
#1

[eluser]amw_drizz[/eluser]
I am running into an issue with the pagination library. It will create the links, and the links will navigate only the forward pages. It never changes the "disabled" number to what page it is. Meaning it never changes from 1. I can click on 2,3,etc and it will show the right data but the pagination links never update so I can click on 1.

Where the pagination is at the top of the function. Like I said, it loads the pagination but it doesn't update the links just stays static
Code:
function getUserList($offset = NULL,$limit = 25,$filter = FALSE, $filter_array = NULL){
        //echo $limit;
        if($filter == TRUE){
            $this->db->select('*')->from('users')->order_by($filter_array['sort_by'],$filter_array['direction'])->limit($limit)->offset($offset);        
        }
        else{
            $this->db->select('*')->from('users')->order_by('id','asc')->limit($limit)->offset($offset);
        }
        $msg_sql = $this->db->get();
        $per_page = $limit;
        if($msg_sql->num_rows() >= 1){
            $num_rows = $msg_sql->num_rows();
            $base = base_url().'admin/manage/users/';
            if($filter == TRUE){
                $config['base_url'] = $base.'filter/'.$filter_array['sort_by'].'/'.$filter_array['direction'].'/'.$filter_array['limit'].'/';
            }
            else{
                $config['base_url'] = $base;
            }
            $config['total_rows'] = $this->db->get('users')->num_rows();
            $config['per_page'] = $limit;
            $config['full_tag_open'] = '<p style="text-align: center">';
            $config['full_tag_close'] = '</p>';
            $this->pagination->initialize($config);
          // php code for table template render
// end code
            $content .= $this->table->generate();
            $content .= "Paging should be here";
            $content .= $this->pagination->create_links();
        }
        return $content;
        //return $array;

    }

So any ideas on how to solve? If it helps all of this is in a Model. This particular controller/model set doesn't use any views. Everything is generated from CI with the use of helpers and HEREDOC's for longer lines of html (ie 5+)

TIA Jon




Theme © iAndrew 2016 - Forum software by © MyBB