Wiki

Articles tagged with "cgridview", sorted by commentsX
Displaying 31-40 of 62 result(s).

Customize CGridView columns directly in your view

Created about a year ago by clapasTips4 comments – viewed 19,076 times – ( +3 / -2 ) – version 1.1
You usually take a model instance passed into your view to provide data to a CGridView in this way:

Using standard filters in CGridView custom fields

Created 3 years ago by GOshaHow-tos4 comments – viewed 47,686 times – ( +16 ) – version 1.1
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.For example: We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0. So we do the usual thing:

Keeping a running total in a CGridView

Created 3 years ago by Steve FriedlHow-tos4 comments – viewed 21,419 times – ( +24 ) – version 1.1
This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!
tags: CGridView

Adding a date range search for CGridView the easy way

Created about a year ago by mikewalenTips4 comments – viewed 14,754 times – ( +10 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.

CButtonColumn and Font Awesome icons

Created 10 months ago by DerekCTips3 comments – viewed 8,746 times – ( +4 )
I was looking for a way to use Font Awsome icons instead of the default images in a CGridView -> CButtonColumn. Perhaps this will be useful to someone.

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,544 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...

Saving CGridView filter

Created 5 months ago by sefburhanTutorials3 comments – viewed 2,762 times – ( +26 ) – version 1.1
In this tutorial we will try to save cgridview filter(search) with title etc. basically we want to save two forms data i.e one represents filters and other data about filters like title, description etc. You can define your own structure for filter saving table here are some basic steps

Update CGridview row separately using ajax request

Created 2 months ago by KonApazHow-tos3 comments – viewed 2,036 times – ( +5 ) – version 1.1
There are cases you want to update a record on CGridview directly

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created about a year ago by Xgamer99Tips3 comments – viewed 8,558 times – ( +1 ) – version 1.1
I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it or on the 'select all' checkbox.

Update specific cgridview html row after AJAX request

Created about a month ago by KonApazHow-tos3 comments – viewed 1,456 times – ( +1 ) – version 1.1
After of model update (successfull or not) throught CGridView (check the below link) you probably need to updates the specific row html in cgridview (not entire cgridview)