Showing 1-19 of 19 items.

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

Created 13 years ago by le_top le_top, updated 13 years ago by le_top le_top. 0 comments

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.

3 0
3
Viewed: 18 374 times
Version: 1.1
Category: Tips

Adding a date range search for CGridView the easy way

Created 13 years ago by mikewalen mikewalen, updated 12 years ago by mikewalen mikewalen. 6 comments
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
  3. Modify the _search form view to add the date range inputs
6 0
11
Viewed: 46 171 times
Version: 1.1
Category: Tips

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

Created 13 years ago by Xgamer99 Xgamer99, updated 13 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 3 comments

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 o...

1 0
7
Viewed: 25 048 times
Version: 1.1
Category: Tips

Special $variables in CGridView and CListView

Created 14 years ago by Steve Friedl Steve Friedl, updated 14 years ago by Steve Friedl Steve Friedl. 11 comments

The popular [CListView] and [CGridView] widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

23 1
33
Viewed: 81 714 times
Version: 1.1
Category: Tips