在codeigniter中jquery分页出错.
if per_page=5; total number 6 and total page 2 but the pagination like below Showing 6 to 6 of 6 | < 1 2 But only 5 is shown and last one show in 2nd page.
嗨朋友,我陷入了这个bug.这个节目在每一页.Pls给我一个解决方案,以获得正确的分页
下面的代码正在使用:
$config['base_url'] = site_url('settings/view_leave_reason_ajax/'); $config['total_rows'] = $this->leav->getLvReasonCount(); $config['per_page'] = 5; $config['anchor_class'] = 'ajax_links'; $config['show_count'] = true; $config['div'] = '#list_view'; $this->jquery_pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $data["links"] = $this->jquery_pagination->create_links(); $data['page'] = $page; $data['result'] = $this->leav->getLvReason($config["per_page"], $page);
关于以下ci分页的问题:
https://github.com/neotohin/CodeIgniter-Ajax-pagination-Library
查看页面:
No Details Exist hrm->encData($row['id']); ?>" >
Nouphal.M.. 5
你定义了
$config['div'] = '#list_view';
在您的配置中,但您尚未在视图中定义该容器.因此,不会发送任何ajax调用.
所以不要这样
尝试将容器放在下面:
也在分页库中 Jquery_pagination.php
改变这一行的line number 184
,从
if( ( $curr_offset + $this->per_page ) < ( $this->total_rows -1 ) )
至
if( ( $curr_offset + $this->per_page ) <= ( $this->total_rows -1 ) )
它会工作......