How to implement Codeigniter Default pagination with pjax

I want to implement jQuery Pjax library using codeigniter. Another function is working fine. But when I added it paginated, and it does not work. when i click the pagination button than its change url, but suddenly after restarting it with normal php not ajax ..

$this->load->library('pagination'); $FilterData = $this->input->get(); $config = bootstrapPagination(); $config['base_url'] = main_url('members'); $config["total_rows"] = $this->member->browse_search_total($FilterData); $config["per_page"] = PER_PAGE; $config['reuse_query_string'] = TRUE; $this->pagination->initialize($config); $data["links"] = $this->pagination->create_links(); $data['members'] = $this->member->browse_search($FilterData, PER_PAGE, $offset); $this->pagination->initialize($config); $data['links'] = $this->pagination->create_links(); if (isset($_SERVER['HTTP_X_PJAX']) && $_SERVER['HTTP_X_PJAX'] == TRUE) { $this->load->view('show_members', $data); } else { $this->output->set_template('frontend'); $this->output->set_title('Members | ' . sitename()); $this->load->view('show_members', $data); } 
+8
codeigniter pagination pjax
source share
3 answers

I solved the problem with:

 $.pjax.defaults.timeout = 3000; 
+1
source share

Just try the following configuration value

 $config['page_query_string'] = TRUE 
0
source share

How can you get $config["total_rows"] ??

I think it should $config["total_rows"] = $this->member->browse_search_total($FilterData)->num_rows();

0
source share

All Articles