Created 6 years ago by Joblo – Tips – 13 comments – viewed 154,441 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.
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully deleted or if there are some problem in flash style (setFlash() / getFlash())
The popular CListView and CGridView widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.