GridView - Ajax update

Hi,

I’m evaluating Yii and I like it. I’m looking at bundled Blog demo. I have one question: How does CGridView works when I click on column header and the content of the grid is sorted?

When I’m watching http requests I see that whole page is returned back to the sort ajax request as a response. Is it then somehow parsed and only CGridView component is refreshed? If this is correct then why? What happens if there are more grids on the page? All SQL queries are executed and their result is not used?

Thanks,

Kuba

jQuery is used to get only the needed sections that are replaced on the current page…

The idea of the blog demo is for new users to get to know Yii, not to make the optimized site… so returning the complete page is just a convenience here… of course like you noted… all the queries would be executed here…

For production and better performance you should use a separate view for every grid view… and call it with renderPartial() so that only the grid is returned…