Wiki

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

Adding a date range search for CGridView the easy way

Created 2 months ago by mikewalenTips2 comments – viewed 3,806 times – ( +6 )
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.

BootProgressColumn - Progress Bar Inside GridView Column compatible with 'bootstrap' extension

Created 10 months ago by LuizTips1 comment – viewed 5,988 times – ( +6 )
A little hint of how to create a progress bar inside the column of the grid, using the 'bootstrap' extension.

Search method of a model for filters when using dates - unixtimestamp in database

Created 2 years ago by MukkeTips1 comment – viewed 15,063 times – ( +10 )
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

Limit a CGridView field to some preset length.

Created 2 months ago by le_topHow-tos1 comment – viewed 2,359 times – ( +8 )
Sometimes text inside a gridview column is just too long. That's why I figured out a way to make the column smaller while still providing the information.

CGridView keep focus on the control after filtering

Created about a year ago by jayalaHow-tos0 comments – viewed 5,130 times – ( +4 )
You can find the reason why I wrote this article here.
tags: CGridView, filter

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

Created about a year ago by c@cbaTutorials0 comments – viewed 16,327 times – ( +20 / -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...

Create custom button button with AJAX function in CGridView

Created 7 months ago by nkdHow-tos0 comments – viewed 9,764 times – ( +5 )
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.

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created about a month ago by le_topTips0 comments – viewed 2,411 times – ( +4 )
Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.