4
I’m having trouble finding a way to paginate using AJAX. I’m used to doing it the traditional way and directly with the server using Codeigniter as framework application. However, this time I need it to be done without the refresh page. Below follows the pagination code made in Codeigniter. What is the correct way to use AJAX for this application?
# Preparando o limite da paginação
$de_paginacao = ( $de_paginacao < 0 || $de_paginacao == 1 ) ? 0 : (int) $de_paginacao;
# Carrega a biblioteca
$this->load->library(array('pagination'));
# Acessa o Model, executa a função get_all() e recebe os contatos
$pedidos = $this->model_pedido->get_all($de_paginacao, $this->pedidos_pagina);
# Paginação
$config_paginacao['base_url'] = site_url('admin/all/');
$config_paginacao['total_rows'] = $this->model_pedido->count_rows();
$config_paginacao['per_page'] = 10;
$this->pagination->initialize($config_paginacao);
$dados['html_paginacao'] = $this->pagination->create_links();
NOTE: this is the default paging code for Codeigniter. There is another way?