Wiki

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

CButtonColumn: Use special variable $data for the 'id' in the 'options' of a button

Created 9 months ago by bluezedTutorials5 comments – viewed 7,190 times – ( +6 )
In an application I had a CGridView with a CButtonColumn and for an Ajax-Request I needed to make sure that the IDs of the buttons would not change when the GridView was updated so in effect I wanted to link them to the $data->id. So I tried:

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

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

CGridView keep focus on the control after filtering

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

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

Created 6 months ago by Xgamer99Tips3 comments – viewed 4,035 times – ( +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.

Adding a date range search for CGridView the easy way

Created 2 months ago by mikewalenTips2 comments – viewed 3,788 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.

Adding a link to a CDataColumn

Created 2 months ago by le_topTips4 comments – viewed 2,724 times – ( +3 )
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.

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

Created about a month ago by le_topTips0 comments – viewed 2,394 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.

Limit a CGridView field to some preset length.

Created 2 months ago by le_topHow-tos1 comment – viewed 2,344 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.