Showing 41-60 of 65 items.

Dynamic parent and child CGridView on single view. Using $.ajax to update child gridview via controller, after row in parent gridview was clicked.

Created 14 years ago by Gerhard Liebenberg Gerhard Liebenberg, updated 12 years ago by Gerhard Liebenberg Gerhard Liebenberg. 20 comments

Many desktop programmers are used to having dynamic forms, where clicking on a record in a parent sub-form, updates another sub-form with the child records. While having many levels of nested sub-forms in a single view might not be such a good idea for a web application, I thought doing it one level deep might be interesting and useful. But, instead of sub-forms I used CGridViews.

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 3 comments

    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this:
'value'=>'$data->author->username',.
    Now we might want to use $data in the declaration of the `...

19 1
14
Viewed: 85 098 times
Version: 1.1
Category: Tutorials

Special $variables in CGridView and CListView

Created 14 years ago by Steve Friedl Steve Friedl, updated 14 years ago by Steve Friedl Steve Friedl. 11 comments

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.

23 1
33
Viewed: 81 713 times
Version: 1.1
Category: Tips

Update/delete model with CJuiDialog (works in CGridView)

Created 15 years ago by ifdattic ifdattic, updated 15 years ago by ifdattic ifdattic. 7 comments

This tutorial will show you how to create Ajax dialog which allows to create new model, update or delete existing model. It works with simple links, CGridView button column links, adds a minimal amount of code and degrades gracefully with JavaScript turned off.

15 0
25
Viewed: 81 486 times
Version: 1.1
Category: Tutorials

How to show ajax delete status in CGridView like flash messages

Created 15 years ago by hasanavi hasanavi, updated 13 years ago by adlersd adlersd. 12 comments

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 dele...

17 0
30
Viewed: 61 384 times
Version: 1.1
Category: How-tos