Welcome Guest, Not a member yet? Register   Sign In
jQuery pagination!. please help me?
#1

[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>&lt;input type="checkbox" name="remember_me" value="true" &gt;&lt;/th>
                <th>#</th>
                <th>نوع</th>
                <th>نام</th>
                <th>ستاره - نوع</th>
                <th>آدرس</th>
                <th>شماره تماس</th>
                <th>نمابر</th>
                <th>وب سایت</th>
                <th>ایمیل</th>
                <th>زمان ثبت</th>
        </tr>
        
    &lt;?php
    //echo $this->table->generate($results);    
        foreach ($results->result() as $row)
        {
                echo    '<tr id="paginate"><td>&lt;input type="checkbox" name="remember_me" value="true" &gt;&lt;/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>';
            }
    ?&gt;
        
    </table>
    &lt;?= $this->pagination->create_links();?&gt;
</div>
With respect
#2

[eluser]jvicab[/eluser]
try using post instead of get. CI unsets get array by default
#3

[eluser]SaSa[/eluser]
[quote author="jvicab" date="1313436568"]try using post instead of get. CI unsets get array by default[/quote]

Thank you for the answer, what is your purpose of get?
Is possible tell me an example if my code?




Theme © iAndrew 2016 - Forum software by © MyBB