⚠ 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

How not to load whole table at once?



MarkC
  • profile picture
  • Member

Posted 03 November 2012 - 19:03 PM

If this is not available, than Grocery CRUD is only for small CMS as I can see it. I was impressed about the way Grocery CRUD was working, I customised it perfectly according my needs, but when I entered 10.000 entries in the Table, the whole admin became really slow, I guess it's because it is loading all of the data at once. With 1000 entires I can say that the speed is fine, but with 10.000 it is preaty slow. I didn't even wanted to test it with 100.000 entries or even more.

I saw the page source, and all of the 10.000 entries were there, not just 10/25/50/100 as I choose from the drop down menu.

Is there any solution or I have to start from the begging and implement my own CRUD panel with paging...?

Here is my table structure, standard fiels for CMS with posts.

int(11) - id
varchar(150) - title
tinyint(4) - category
varchar(100) - url
tinyint(4) - author
datetime
varchar(100) - image url
text - this is no more than 300 character
text - this is really big, but in the test it's also 200-300 characters so it's not big in the test
int(11) - counter for the visits
tinyint(4) - active status

Any help is appreciated.

victor
  • profile picture
  • Member

Posted 03 November 2012 - 20:40 PM

HI! Jane and welcome to the forum!
If you uses datatables theme - this is normal , because a grid is created from all rows.
if you uses default theme you can change the grocery_crud_model.php.
More info about this problem here:
/topic/497-adding-set-relation-results-in-a-time-out-from-the-database/#entry2036

Good luck!

MarkC
  • profile picture
  • Member

Posted 03 November 2012 - 21:35 PM

Thanks for the welcome and the quick reply.

I'm in a hurry now, I will try the solution tomorrow. I just have one more question for you.

Yes, I use the datatable theme, but is there an option to use the first theme (the way it works with the entries from the database) but with the graphic design of the datatable theme? That would be perfect for me.

victor
  • profile picture
  • Member

Posted 03 November 2012 - 21:52 PM

These themes have a various logic of work.

1) Datatables:
This theme uses Javascript to search and sort data. All rows is loaded before manipulations with them.
2) Flexigrid uses Ajax for these operations.

These themes are products of third-party developers.
P.S. Sorry. My English is poor. :rolleyes:

MarkC
  • profile picture
  • Member

Posted 04 November 2012 - 12:49 PM

OK and one more question, is it possible to use the Flexigrid with Ajax as it is, but I want only the graphics design (the colors and style + the fluid layout)?

In other words, can I just change the css for the Flexigrid and apply the css from the datatable design? I don't need the sorts etc.

victor
  • profile picture
  • Member

Posted 04 November 2012 - 13:06 PM

You can change the css and views as you like.
But be careful with the id and classes, because if you rename id or classes it can cause mistakes at work.