Jump to content

set_relation_n_n lines row limit render


  • Please log in to reply
2 replies to this topic

#1 MasterMosquiton



  • Members
  • Pip
  • 1 posts

Posted 11 November 2011 - 11:24 AM


i have a question about set_relation_n_n function and rendering of the results.

The scenary is a blog about movies, just same as your example.

My code is something like this

   $crud->set_relation_n_n('actors', 'people_movies', 'people', 'movie_id', 'people_id', 'name', 'role')->where('role','regista');
   $crud->set_relation_n_n('categorie', 'categories_movies', 'categories', 'movie_id', 'category_id', 'name');
$crud->fields('title', 'actors', 'categorie');
$output = $crud->render();

People table counts is 5k+ rows, Movies table count is 400+ rows, Categories table count is 20 rows.
Join query between categories, movies and peoples took about 0,002 sec on my database, so it's not a db issue.
My problem is that when the browser try to render the page, a script in the page send the browser in timeout.

My personal opinion is : the array passed to the javascript function that render the multi-select for actors is too big with 5k+ lines and the script goes in block.

What do you think about it?

Thanks in advance for your answer, and sorry for my bad english.


#2 crina



  • Members
  • PipPip
  • 17 posts

Posted 02 March 2012 - 07:37 AM


The only thing I can think about, in solving this problem is to make the page load using AJAX, and put a spinner in the page until the whole page loads (all the data and all the scripts) ...
I have encountered the same problem ... and I am planning to implement this ... but maybe only in a few days, now I have other issues to take care ...

#3 web-johnny


    grocery CRUD Author

  • Administrators
  • 1,150 posts
  • LocationLondon

Posted 03 March 2012 - 11:13 AM

Hello there,

Don't worry about it . I will try to include this functionality to the next version.I will do my best to add it. And it is simple , just after a limitation for example 500 rows grocery CRUD will change the input automatically to ajax . I already start with this but it needs lot of work, so please be patient with this feature. I will also have the same feature for the simple set_relation also.
Posted Image

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users