When dealing with lots of records, we found that the AJAX requests in Yii's standard format was quite slow.
The reason is that the AJAX response returns the full page when
the programmer does not make use of
renderPartial on its views and also, even with the use of
that method, the response returns the full HTML source.
We thought that we could speed up the server response if we just return a bunch of JSON objects that will be later on rendered on the client. Also, we thought that if we could somehow stored the results on the client we could reduce the amount of requests to the server... and we think we did it.
For correct functioning of the grid, it's example usage has to be on separate page. Go to basic example page for TbJsonGridView to watch Json Grid View in action.
Here's all configuration properties which you can set for TbEditableView widget.
boolean json = null
|Will be set to true if its an AJAX request. The grid will respond automatically with a JSON object when that occurs.
integer cacheTTL = 1
|The number of seconds, minutes of hours we keep server responses on cache.
string cacheTTLType = "s"
|The type of cache duration
m (minutes) or
boolean localCache = true
|Whether to use local cache or not.
In order to work with TbJsonGridView, there are certain classes to be used with this special component. Without them, the grid won't work as expected.
All of the examples will be on separate pages.