[eluser]SaSa[/eluser]
Why not change pagination after click (pagination page change but it no)?
I mean is here in my example (this not change after click):
http://i.stack.imgur.com/zM3Ej.gif
EXAMPLE:
My code
Js code:
Code:
$('.pagination a').live('click', function(e) {
e.preventDefault();
$.ajax({
type: "GET",
url: $(this).attr('href'),
success: function(data){
$('tr#paginate').replaceWith( $(data).find('tr#paginate') );
}
});
return false;
});
Controller:
Code:
function show($offset = 0)
{
$this->admin_model->header();
$this->load->library('pagination');
//$this->load->library('Jquery_pagination');
$config['base_url'] = base_url().'admin/accommodation/show';
$config['uri_segment'] = 4;
$config['total_rows'] = $this->db->count_all('hotel_submits');
$config['per_page'] = '3';
//$config['div'] = '#num_count'; /* Here #content is the CSS selector for target DIV */
//$config['num_links'] = 10000;
$config['full_tag_open'] = '<div id="pagination">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);
$offset = (int) $offset; // just to make sure nothing funky gets in here
$data['results'] = $this->db->query("SELECT @rownum:=@rownum+1 rownum, t.*
FROM (
SELECT *
FROM hotel_submits
ORDER BY id desc
LIMIT $offset, 3
) t,
(SELECT @rownum:=0) r");
////////////////////////
$this->load->view('admin/accommodation_submit_show', $data);
}
view:
Code:
<div class="table_show">
<table>
<tr>
<th><input type="checkbox" name="remember_me" value="true" ></th>
<th>#</th>
<th>نوع</th>
<th>نام</th>
<th>ستاره - نوع</th>
<th>آدرس</th>
<th>شماره تماس</th>
<th>نمابر</th>
<th>وب سایت</th>
<th>ایمیل</th>
<th>زمان ثبت</th>
</tr>
<?php
//echo $this->table->generate($results);
foreach ($results->result() as $row)
{
echo '<tr id="paginate"><td><input type="checkbox" name="remember_me" value="true" ></td>';
echo '<td>'.$row->rownum.'</td>';
echo '<td>'.$row->type.'</td>';
echo '<td>'.$row->name.'</td>';
echo '<td>'.$row->star.' - '.$row->type_star.'</td>';
echo '<td><span id="'.$row->address.'" class="tooltip">'.$row->address.'</span></td>';
echo '<td><span id="'.$row->number_phone.'" class="tooltip">'.$row->number_phone.'</span></td>';
echo '<td>'.$row->fax.'</td>';
echo '<td>'.$row->site.'</td>';
echo '<td>'.$row->email.'</td>';
echo '<td>'.$row->date.'</td></tr>';
}
?>
</table>
<?= $this->pagination->create_links();?>
</div>
With respect