This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
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...
Here's a tutorial on how to create a CGridView with external date filters the trick is to create hidden columns within the CGridView Filters something like in the example below:
class Post extends CActiveRecord {
...
}
`
When you list Authors in grid you would like to print the count of posts in column, allow sorting on this column and probably filtering by the count.
Clearing CGridView filters and sort orders from the web pages, is usefull for the end user. Yii does not seem to propose a standard method. Furthermore, this is especially usefull when filters are "remembered" in the user's session.
The problem is not new: after setting some filters in a grid (typically in admin view), and gone to another page, returning in the grid's page I would like to find the filters with previous setting mantained.
The CGridView widget is very useful and customizable, but sometimes you need a little more. One limit I found is to have only one row for headers; yes, you can write each column header in more than one row, but just inside the single cell. I was looking instead for the possibility to use more than one row, with different structure one from the others. This way **you can write columns grouping h...
There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?
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.
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dat...
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)
CGridview displays existent rows of the table (using DataProvider)
This wiki shows about how to make a custom column or how to pass php-Yii-html code in CButtonColumn (as a button)
There are cases you want to update a record on CGridview directly
Assume that you have teachers and students model.
Hi buddies !, This tutorial shows about how to add a custom button with your own icon for your CGridView of Yii framework
Suppose you have an Application in Yii that manages hotels each one has many customers.
We can use a CJuiDatePicker for a CGridView inline filter.
Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.
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.
This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.