I have a question about how to properly use CGridView in my particular case. I have a view with two elements: an image and a CGridView:
<html> <body> <img src="<?php echo $imgURL; ?>" /> <?php this->widget("zii.widgets.grid.CGridView", array( "dataProvider" => $dataProvider, "columns" => $columns )); ?> </body> </html>
In my controller, it does some work generating an image (and returns the URL so it can be displayed in the view), and at times this can take a few seconds depending on how large the $dataProvider output is. When I change pages in the CGridView it’s performing an AJAX call and loads the whole page, so that image is getting generated each time the user clicks a page number.
What would be the proper way to handle the CGridView here as to not regenerate the image each time the page is changed? I’m new to Yii (if that wasn’t obvious) but not to PHP. Any help or insights would be greatly appreciated.