Wiki

Articles tagged with "cgridview"X
Displaying 21-30 of 62 result(s).

How to avoid rendering entire page on AJAX call for CGridView and CListView

Created about a year ago by VINAY Kr. SHARMAHow-tos5 comments – viewed 12,981 times – ( +5 )
CGridView and CListView are great widget to populate records and also provides features like ajax update, column sort, search, drop-down filter, ajax content load and many more...

multiple CActiveDataProviders in one CGridView

Created about a year ago by KonApazHow-tos5 comments – viewed 9,479 times – ( +7 / -1 )
There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?

Search a file size range in CGridView

Created about a year ago by CrazyCatTips0 comments – viewed 3,218 times – ( +2 )
Working on a report system of files transfert, I had to let the users simply find files by size. I didn't want to have two fields, I prefer a simple text input, with "human syntax".

CGridView. Add custom class to table rows preserving original „odd“ and „even“

Created about a year ago by Maug LeeHow-tos2 comments – viewed 17,006 times – ( +4 ) – version 1.1
Lets say we have such a CGridView widget showing a list of users for administrator. Users have status „active“ or „disabled“. Grid widget puts class „odd“ or „even“ to rows and we want to preserve this. So we want to add a class „disabled“ to rows with disabled users.

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

Created about a year ago by le_topTips0 comments – viewed 6,197 times – ( +5 ) – version 1.1
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.

Adding a date range search for CGridView the easy way

Created about a year ago by mikewalenTips4 comments – viewed 14,771 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.

Adding a link to a CDataColumn

Created about a year ago by le_topTips6 comments – viewed 7,922 times – ( +3 ) – version 1.1
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.

Limit a CGridView field to some preset length.

Created about a year ago by le_topHow-tos1 comment – viewed 7,343 times – ( +12 ) – version 1.1
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.

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

Created about a year ago by Xgamer99Tips3 comments – viewed 8,563 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.

Create custom button button with AJAX function in CGridView

Created about a year ago by nkdHow-tos1 comment – viewed 30,825 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.