Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it.
I am surprised that this is not in the default implementation, so I made my default CGridView implementation.
Updated 4 years ago by Joblo – Tips – 13 comments – viewed 150,486 times
( +74 / -1 )
If you have to display a overview of related data in a table,
you can use the CListView, create your view with table/tr/td tags
and implement db-queries in the view to display detaildata of the current (master-)record.
If you're working a lot with extensions you often stumble upon problems, when you want to include them into your custom web application, like hardcoded or absolute path aliases or classes extended from core application components, which implement addiditonal features.
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post.
For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.
The article Fixing extensions without modifying their code reminded me of another patching technique that I used. My conviction and a hard look on the web had led me to an article Redefine PHP class methods or class giving me a head start to do what I wanted: patching third party code without touching the original to allow easy upgrades.