Wiki

Articles tagged with "cgridview", sorted by viewsX
Displaying 11-20 of 62 result(s).

Special $variables in CGridView and CListView

Created 2 years ago by Steve FriedlTips10 comments – viewed 40,440 times – ( +24 / -1 ) – version 1.1
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.

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created about a year ago by yJeroenTutorials8 comments – viewed 38,061 times – ( +17 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.

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

Created 2 years ago by c@cbaTutorials3 comments – viewed 35,578 times – ( +27 / -1 ) – version 1.1
    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 htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

CGridView: Update/create records in a CJuiDialog

Created 2 years ago by JobloTips11 comments – viewed 34,747 times – ( +14 ) – version 1.1
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.

CGridView: Display the full record (actionView) in a CJuiDialog

Created 2 years ago by JobloTips7 comments – viewed 33,061 times – ( +15 ) – version 1.1
If you show a model (with a lot of attributes) partially in a CGridView, it can be helpful when the user can take a quick look at the full record with all attributes without displaying the view as a page and afterwards returning back to the gridview.

How to show ajax delete status in CGridView like flash messages

Created 3 years ago by hasanaviHow-tos12 comments – viewed 31,369 times – ( +21 ) – version 1.1
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())

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 3 years ago by xrxHow-tos16 comments – viewed 31,243 times – ( +23 ) – version 1.1
Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.

Create custom button button with AJAX function in CGridView

Created about a year ago by nkdHow-tos1 comment – viewed 30,829 times – ( +14 ) – version 1.1
CButtonColumn in CGridView can be customised to include user built buttons. To learn a great deal about including custom buttons, read this excellent wiki. This tutorial will show how to call an action from one custom button using AJAX instead of regular GET calls.

Using CJuiDatePicker for CGridView filter

Created 2 years ago by softarkHow-tos12 comments – viewed 30,039 times – ( +20 ) – version 1.1
We can use a CJuiDatePicker for a CGridView inline filter.

Filter / Search with CListView

Created 2 years ago by JohnPollardHow-tos7 comments – viewed 29,492 times – ( +25 ) – version 1.1
This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.