Wiki

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

Displaying image in a CGridView column.

Created 3 years ago by sirin kHow-tos5 comments – viewed 57,745 times – ( +13 / -1 ) – version 1.1
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
tags: CGridView, image

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

Created 4 years ago by c@cbaTutorials3 comments – viewed 55,538 times – ( +28 / -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...

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 3 years ago by yJeroenTutorials8 comments – viewed 54,373 times – ( +21 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.

Create custom button button with AJAX function in CGridView

Created 3 years ago by nkdHow-tos2 comments – viewed 48,378 times – ( +19 ) – 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 4 years ago by softarkHow-tos21 comments – viewed 46,211 times – ( +27 ) – version 1.1
We can use a CJuiDatePicker for a CGridView inline filter.

CGridView: Update/create records in a CJuiDialog

Created 4 years ago by JobloTips12 comments – viewed 45,396 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'.

How to filter CGridView with From Date and To Date datepicker

Created 3 years ago by kiran sharmaTips16 comments – viewed 43,130 times – ( +17 / -4 ) – version 1.1
This artical is related to allow user to filter CGridView with date range using datepicker on submit button. Here I use Yii Cookie to preserve date in datepicker textbox after submitting the form.

How to show ajax delete status in CGridView like flash messages

Created 4 years ago by hasanaviHow-tos12 comments – viewed 42,480 times – ( +24 ) – 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())

Exporting CGridView results to CSV file

Created 4 years ago by RusAlexTutorials9 comments – viewed 41,497 times – ( +6 / -3 ) – version 1.1
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
tags: cgridview, export, csv

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

Created 4 years ago by JobloTips7 comments – viewed 40,762 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.