⚠ 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

Increase loading page in datatables theme



Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 14 May 2014 - 18:53 PM

Hi everyone! I write so many posts  that people do not have time to respond to previous :)  just a joke!

Well, let's talk about  increasing page loading in datatables theme. Any solutions?

1) Write indexes in Mysql database, does it help for list output?

2) I wrote custom model with join tables, that help me very much! Now I don't need send query in every callback_column where i need values from another related table! COOL! Is any other solutions like this one?

3) What about using CI caching with GC? Any examples? I don't using caching at all yet, but I know that need to refresh cache after change data, where in GC operation I could do that?

Other speed up technics
...?

And yes I know that datatables load all rows. So Can you, guys, shares with your own  ways to combat with this
?

As always, thank you in advance, I will be very grateful! ;)

 

 

 

 

 

 


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 15 May 2014 - 06:12 AM

a better option - use flexigrid.

If you still plan to use data tables - u need to modify the library to accept server side paging. This is an option available with data-tables but dont think is implemented with GC datatables themes .. might be some technical limitation or complex enough to genralize it. But if u can - that will be great feature :)


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 15 May 2014 - 11:06 AM

Hi! thank you very much! So conclusion is that I need to using another theme. Iwrite this post because I have load to output view data from two tables at the same time in every row concatenate two DB objec.

First solution was get value of second DB object by callbacks column, but I have about 3000 rows, so many CALLBACK_COLUMN x EACH ROW x NUMBER OF GETTING FIELDS FROM ANOTHER TABLE.

And in datatables theme this is all loading about  4-5 seconds. I wrote custom model and do only one query for each row, all the same - queries 0.745 sec but displaying 3-4, I couldn't imaging what will be if I will have 5000 or
 

more. So yeah, using flexifrid one way for now! Just test it, everything works so fast! Many thanks, Amit Shah !

EDIT: implement by myself server-side processing with datatables theme...mmmm....sweet dreams.. :)


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 15 May 2014 - 19:08 PM

well many ppl are looking for the same solution of having server side processing with datatables themes.. u can share your piece of code on the same ... it might help a lot many other ppl like u in need ..

 

and happy GCing:)


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 15 May 2014 - 22:36 PM

Yeah, if I will do that I will post solution here 100%, because I know how to hard to looking for different like this one solutions, be shure!


thephpx

thephpx
  • profile picture
  • Member

Posted 02 April 2015 - 06:11 AM

Hmm, its been long since this topic has been update but in case someone still looking for a way to get data-table to fetch limited data to avoid increased loading and have server side processing then you can check this out. 


Samvel Nikoghosyan

Samvel Nikoghosyan
  • profile picture
  • Member

Posted 03 October 2015 - 06:38 AM

Hi Paul can you please share the code that you use to change from client side to server-side processing with Grocery Crud datatables theme. It will be very helpful the flexigrid is not the best option for our project. Ochen vajno I nujno pojalusta. Thank you in advance.

Regards
Samvel Nikoghosyan

ixsyiok

ixsyiok
  • profile picture
  • Member

Posted 13 October 2016 - 16:53 PM

Hi all, i thought of a workaround for the topic and currently is using it without an problem for a 9000++ entries in the table. Here's what i do.

 

Steps:

1. Use datatables theme to load the table, then set the $crud->limit(1,0); With this, the datatable from grocerycrud will only load 1 row of data.

2.Then, i create a new view of showing the exact table with server-side script as shown in the datatables official site https://datatables.net/examples/data_sources/server_side.html

3. In the new view of the table, i use mrender for the last column to display buttons to read, edit and delete the row using the api.

4. Finally, i set the grocerycrud's datatable to display:none, then the page only display the new server-side table and work seamlessly with GC's api.

 

P/s: i don't know if this method is legit or even close to am acceptable answer but hey, at least it works as needed til an official version is out.

 

Cheers