脚本宝典收集整理的这篇文章主要介绍了php – CodeIgniter / jQuery – 分页 – 无尽的分页,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$('#results').pageless({ totalPages: 10,url: '/theurl/index',loaderMsg: 'Loading more results' });
我在codeigniter控制器中的代码如下
$config['base_url'] = base_url() . 'theurl/index'; $config['total_rows'] = $this->model->record_count(); $config['per_page'] = 20; $config['uri_segment'] = 3; // Init the config $this->pagination->initialize( $config ); // Create pagination $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $data['results'] = $this->onyafeet->fetch_results($config['per_page'],$page); $data['links'] = $this->pagination->create_links(); // Load the view and pass through all the data $this->load->view('theurl/index',$data);
当我运行代码并到达页面底部时,它确实有效,但它也会将输入页面加载到它为结果创建的新div中.
任何帮助将不胜感激.
干杯
$config['base_url'] = base_url() . 'theurl/index'; $config['total_rows'] = $this->model->record_count(); $config['per_page'] = 20; $config['uri_segment'] = 3; // Init the config $this->pagination->initialize( $config ); // Create pagination $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $data['results'] = $this->onyafeet->fetch_results($config['per_page'],$page); $data['links'] = $this->pagination->create_links(); // AJAX load: if ($this->input->is_ajax_request) { $this->load->view('theurl/partial/ajax_partial',$data); } else { // Load the view and pass through all the data $this->load->view('theurl/index',$data); }
以上是脚本宝典为你收集整理的php – CodeIgniter / jQuery – 分页 – 无尽的分页全部内容,希望文章能够帮你解决php – CodeIgniter / jQuery – 分页 – 无尽的分页所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。