D
D
Dmitry Petrik2014-10-07 10:27:57
JavaScript
Dmitry Petrik, 2014-10-07 10:27:57

Yii. CGridView Widget. How to get data after page load?

In general, there was a small problem. CGridView displays a large data table for me, as a result of which the page loads for a rather long time (about 5 seconds). And the estimated amount of data can be much more than what we have now. Those. The page may take longer to load.
Pagination as a solution to the problem is not suitable.
Therefore, there is an idea to display the CGridView empty, and after the page is fully loaded, receive data via an ajax request.
Maybe the CGridView widget has some property that will solve this problem? I couldn't find it...
Or should I have fun with "dataProvider"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
frees2, 2014-10-07
@frees2

It seems that modern browsers already load separately.
Example in php/ via curl.
First, we get the headers from the JSON feed and then the feed, moreover, without ajax.
Click on the box, then you can see www.dulsky.eu/v/Mk7-GRWq7wA on the right.
Everything is done by the browser itself.

E
Evgeny Bukharev, 2015-03-25
@evgenybuckharev

What will give you if you display the CGridView empty and after the page is fully loaded, start filling it with data?
Maybe as an option to do dynamic pagination, that is, first load 10-20 data and then load the rest of the data when scrolling the page down

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question