⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

"datatables" theme loads all my records and then creates pagination?



Georgee
  • profile picture
  • Member

Posted 27 November 2013 - 09:50 AM

hello,

 

I have 5000 records and I am using the "datatables" theme:

$crud->set_theme('datatables');

The problem is that when I load my website, it first loads all records (it takes a little time)

and then cuts the records and creates the pagination.

 

 

how do I avoid loading all records, but just the first page?


Georgee
  • profile picture
  • Member

Posted 28 November 2013 - 10:31 AM

anybody able to help with this issue?

hope I described it clearly!


davidoster
  • profile picture
  • Member

Posted 03 December 2013 - 22:43 PM

Try this, 

$this->db->limit();

Lets you limit the number of rows you would like returned by the query:

$this->db->limit(10);

// Produces: LIMIT 10

The second parameter lets you set a result offset.

$this->db->limit(10, 20);

// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

or this http://www.grocerycrud.com/documentation/options_functions/limit

e.g. $crud->limit(10);


Amit Shah
  • profile picture
  • Member

Posted 04 December 2013 - 06:33 AM

well.. but defies the requirement - whats he gona do with the rest of the records when he needs it my friend?