Welcome Guest, Not a member yet? Register   Sign In
pagination problem
#1

[eluser]Mainboard[/eluser]
hey everyone, i have a little problem with the pagination and i don't know why, the problem is when i pass to the other page, the fields only add to the first page and not load page per page, i charge my pagination in a main html, i don't know if that matter, so my pagination works but not page per page, any idea?
#2

[eluser]Wondering Coder[/eluser]
posting your code will be very helpful to solve your problem!
#3

[eluser]pickupman[/eluser]
Without seeing code, its hard to give an exact answer. If had to guess you are not sending the proper offset/limit to your DB call (assuming in a model) using the URI parameters. Say you have 25 results per page setup in your pagination configuration. First call will fetch from record 0 to 24 (25 total). You click on the pagination link (/somepage/50), and now you are passing that 50 as the limit (0 to 49).
#4

[eluser]praveens[/eluser]
POst your controller and view code.
#5

[eluser]Mainboard[/eluser]
yeah sorry, well this is my code
my Controller
Code:
function display ()
{
          
                
        $this->load->library('pagination');
        $this->load->library('table');
        
        $this->table->set_heading('Codigo Empleado', 'Nombre Completo de Empleado', 'Puesto de Trabajo', 'Ubicacion');
        $this->millenium_db = $this->load->database('millenium', true);    
        
        $config['base_url'] = site_url("link/display"); //'http://localhost:90/intranet/index.php/link/display';
        $config['total_rows'] = $this->millenium_db->get('no_listado_empleado')->num_rows();
        $config['per_page'] = 20;
        $config['num_links'] = 15;
        $config['full_tag_open'] = '<div id="pagination">';
        $config['full_tag_close'] = '</div>';
        
        $this->pagination->initialize($config);
        
        $data['records'] = $this->millenium_db->get('no_listado_empleado', $config['per_page'], $this->uri->segment(3));
        
        $this->load->view('rrhh/site_view', $data);
        
}
My View
Code:
&lt;body&gt;
     <div id="container" align="center">
        <h1>Listado General de Empleados</h1>
        
        &lt;?php echo $this->table->generate($records); ?&gt;
        &lt;?php echo $this->pagination->create_links(); ?&gt;
     </div>
    
[removed][removed]    

[removed]
    $('tr:odd').css('background', '#e3e3e3');
[removed]
&lt;/body&gt;
actually is one of the examples of nettuts and it works, but when i change to the other page the fields add to the same page and not load page per page, i was looking for and i found this link http://ellislab.com/forums/viewthread/151977/ that say that maybe is a problem with a some session, and actually i use this pagination in a intranet, but i don't know why doesn't works




Theme © iAndrew 2016 - Forum software by © MyBB