• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI Pagination and JQuery UI Tabs

Hi together,
I'm using JQuery UI Tabs (http://docs.jquery.com/UI/Tabs)
and in one tab I want to use CI Pagination.

I do get the pagination links and
on click I get the right url in the browsers adressfield.
But nothing else happens. The site does'nt reload.
Does JQuery block it? Am I doing a mistake?
Need some help. Thank You!!!!

function index()

        $config['base_url'] = base_url().'index.php/kasse.html#tabs-4/';
        $config['total_rows'] = $this->db->count_all('ks_buchung');
        $config['per_page'] = '3';
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        $config['first_link'] = 'Neueste';
        $config['last_link'] = '&Auml;lteste';
        $config['next_link'] = '-&gt;';
        $config['prev_link'] = '&lt;-';

        $data['ks_message']       = $this->kasse_model->count_ks_message();
        $data['ks_buchungen'] = $this->kasse_model->get_allmy_ks_buchungen($config['per_page'],$this->uri->segment(1));
        $data['my_ks_buchungen']  = $this->kasse_model->get_my_ks_buchungen();
        $dataform['heading']      = 'Unsere WG-Kasse';
        $dataform['page']         = $this->config->item('FAL_template_dir').'template/kasse/start_kasse_temp';

        $this->load->view($this->_container, $dataform);

function get_allmy_ks_buchungen($num, $offset)
      $wg_id = 0815;

      $this->db->where('wg_id', $wg_id, FALSE);
      $this->db->where('user_id', $this->db_session->userdata('id'), FALSE);
      $this->db->order_by('ks_datum desc, id desc');
      $query = $this->db->get('ks_buchung', $num, $offset);
      if ($query->num_rows() > 0) { $data = $query->result();}
      if (isset($data)){return $data;}

    $(function() {
<div id=headline>&lt;?=$heading?&gt;</div>
<div id="tabs">
        <li><a href="#tabs-1">Overview</a></li>
        <li><a href="#tabs-2">Who paid last times</a></li>
        <li><a href="#tabs-3">community cash box</a></li>
        <li><a href="#tabs-4">My oulays</a>
<div id="tabs-4">
<div id=headline>cash box: My outlays</div>
<table class=finance>
    <td align='left'><font size='-2'>Datum</font></td>
    <td align='left'><font size='-2'>Text</font></td>
    <td align='left'><font size='-2'>Betrag</font></td>
    <td align='left'><font size='-2'>Art</font></td>
    <td align='left'><font size='-2'>Auslage&nbsp;f&uuml;r</font></td>
&lt;?php $count = 1;
  if (isset($my_ks_buchungen))
     { foreach($my_ks_buchungen as $buchung):?&gt;
    <td><font size='-2'>&lt;?=$buchung->ks_datum?&gt;</font></td>
    <td><font size='-2'>&lt;?=$buchung->ks_text?&gt;</font></td>
    <td align='right'><font size='-2'>&lt;?=$buchung->ks_betrag?&gt;</font></td>
    <td><font size='-2'>&lt;?=$buchung->ks_art?&gt;</font></td>
    <td><font size='-2'>&lt;?=$buchung->ks_auslage?&gt;</font></td>

&lt;?php  endforeach;
&lt;?php echo "</table>".$this->pagination->create_links(); ?&gt;

I don't know if that the problem but the offset value seems to be not right:
$data['ks_buchungen'] = $this->kasse_model->get_allmy_ks_buchungen($config['per_page'],$this->uri->segment(1));

$this->uri->segment(1) // usually returns your controller name - no offset value

Thank you LuckyFella73,

you are right, but that doesn't solve the problem.
Any other Idea?

More hints from everybody would be great!!!!

Greetings, Jan

Hi Jan
I have read your code..
There is a problem in ur offset.

Follow this link.This will really help you.

This link provide you a good solution.
By using this code you will be able to perform pagination using ajax in jquery.
You will not have to always post your page by click on the links provided by create_links.
By using the link provided above you can send request through ajax.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.