Welcome Guest, Not a member yet? Register   Sign In
Pagination issue
#13

[eluser]InsiteFX[/eluser]
Your not getting your database records with the limit offset.

This uses modules and my jQuery extended pagination but shuld still work for normal

Code:
// --------------------------------------------------------------------

/**
  * manage()
  *
  * Manage the user database records.
  *
  * @access public
  * @param string
  * @return void
  */
public function manage($offset = '')
{
  // Load the fx_pagination library.
  $this->load->library('fx_pagination');

  // Setup the record limit and get a total count of all table records.
  $limit = 10;
  $count = $this->groups->count_all();

  /**
   * ----------------------------------------------------------------------
   * FX Pagination Configuration.
   * ----------------------------------------------------------------------
   * The base_url and segment below must be set to the correct URL and the
   * segment must be set to the correct segment number or it WILL NOT WORK!
   * ----------------------------------------------------------------------
   */
  $config = array(
   'base_url'      => base_url('groups/manage/'),
   'uri_segment'   => 3,
   'full_tag_open' => '<div id"content" class="text-center"><ul class="pagination pagination-sm page-manage">',
   'display_pages' => TRUE,
   'per_page'      => $limit,
   'total_rows'    => $count,
   'num_links'     => 4,
   'show_count'    => TRUE,
  );

  // Initialize the fx_pagination configuration.
  $this->fx_pagination->initialize($config);

  // Get the database records with limit and offset.
  $order_by  = 'user_id asc';
  $query = $this->groups->get_with_limit($limit, $offset, $order_by);

  // Setup the data array and display the view.
  $data = array(
   'data_grid'   => $query->result(),
   'pager_links' => $this->fx_pagination->create_links(),
   'view_file'   => 'manage',
  );

  $this->load->module('template');
  $this->template->render('admin_fluid_dashboard', $data);
}


Messages In This Thread
Pagination issue - by El Forum - 11-25-2013, 04:24 AM
Pagination issue - by El Forum - 11-25-2013, 05:52 AM
Pagination issue - by El Forum - 11-25-2013, 05:53 AM
Pagination issue - by El Forum - 11-25-2013, 06:01 AM
Pagination issue - by El Forum - 11-25-2013, 06:03 AM
Pagination issue - by El Forum - 11-25-2013, 06:08 AM
Pagination issue - by El Forum - 11-25-2013, 06:08 AM
Pagination issue - by El Forum - 11-25-2013, 06:15 AM
Pagination issue - by El Forum - 11-25-2013, 06:19 AM
Pagination issue - by El Forum - 11-25-2013, 06:22 AM
Pagination issue - by El Forum - 11-25-2013, 06:25 AM
Pagination issue - by El Forum - 11-25-2013, 06:59 AM
Pagination issue - by El Forum - 11-25-2013, 07:36 AM
Pagination issue - by El Forum - 11-25-2013, 07:39 AM
Pagination issue - by El Forum - 11-25-2013, 08:56 AM
Pagination issue - by El Forum - 11-25-2013, 09:34 AM
Pagination issue - by El Forum - 11-25-2013, 11:10 AM
Pagination issue - by El Forum - 11-25-2013, 11:14 AM
Pagination issue - by El Forum - 11-25-2013, 04:12 PM
Pagination issue - by El Forum - 11-25-2013, 04:15 PM
Pagination issue - by El Forum - 11-25-2013, 04:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB