Wiki articles in category How-tos tagged with "CGridView"

Showing 1-20 of 29 items.

Using CButtonColumn to customize buttons in CGridView

Created 14 years ago by Trejder, updated 12 years ago by Gismo.

The easiest way to customize look and behaviour of them is to use series of CButtonColumn properties, like: updateButtonImageUrl (path to image for update button), updateButtonLabel (label for the update button; not HTML-encoded), updateButtonOptions (HTML options for this button, used in the way as many htmlOptions property for many widgets) and updateButtonUrl (a PHP expresion th...

75 0
59 followers
Viewed: 349 071 times
Version: 1.1
Category: How-tos

Using standard filters in CGridView custom fields

Created 14 years ago by GOsha, updated 14 years ago by jwerner.

In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
For example:
We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0.
So we do the usual thing:

<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
    'name'=>'...
14 0
16 followers
Viewed: 75 499 times
Version: 1.1
Category: How-tos

Keeping a running total in a CGridView

Created 14 years ago by Steve Friedl, updated 14 years ago by tydeas_dr.

This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!

22 0
19 followers
Viewed: 81 125 times
Version: 1.1
Category: How-tos
Tags: CGridView

CGridView and AjaxForm Connect

Created 14 years ago by PinkBrainPlan, updated 14 years ago by PinkBrainPlan.

<?php $this->widget('zii.widgets.grid.CGridView', array(

'dataProvider' => $dataprovider,
'id'=>'recipient_table',
    'selectionChanged'=>'updateEditForm',
'columns' => array(
	'rec_id',
            'org.nachname',
            'org.vorname',
            'org_id',
            array(
                'class'=>'CButtonColumn',
                'template'=>'{...
1 0
10 followers
Viewed: 28 527 times
Version: 1.1
Category: How-tos

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 14 years ago by xrx, updated 13 years ago by xrx.

Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.

23 0
29 followers
Viewed: 53 138 times
Version: 1.1
Category: How-tos

How to show ajax delete status in CGridView like flash messages

Created 14 years ago by hasanavi, updated 12 years ago by adlersd.

I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully dele...

17 0
30 followers
Viewed: 57 854 times
Version: 1.1
Category: How-tos

Filter / Search with CListView

Created 13 years ago by JohnPollard, updated 12 years ago by JohnPollard.

This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.

22 0
26 followers
Viewed: 56 743 times
Version: 1.1
Category: How-tos

Using filters with CGridView and CArrayDataProvider

Created 13 years ago by marcovtwout, updated 11 years ago by yugene.

Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.

19 0
29 followers
Viewed: 95 434 times
Version: 1.1
Category: How-tos

Creating a jQueryUI Sortable CGridView

Created 13 years ago by blindMoe, updated 12 years ago by rAWTAZ.

I have had to do this a couple of times now so I figured I would share it with the community. I am going to keep this short because I really hope that you are familiar with jQueryUI's Sortable class before starting this tutorial.

36 0
54 followers
Viewed: 53 888 times
Version: 1.1
Category: How-tos

CGridView keep focus on the control after filtering

Created 13 years ago by jayala, updated 13 years ago by jayala.

You can find the reason why I wrote this article here.

5 0
10 followers
Viewed: 17 911 times
Version: 1.1
Category: How-tos

Using CJuiDatePicker for CGridView filter

Created 13 years ago by softark, updated 11 years ago by Kostas Apazidis (KonApaz).

We can use a CJuiDatePicker for a CGridView inline filter.

19 0
31 followers
Viewed: 65 354 times
Version: 1.1
Category: How-tos

Searching and Sorting by Count of Related Items in CGridView

Created 13 years ago by softark, updated 10 years ago by softark.

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.

21 0
40 followers
Viewed: 61 466 times
Version: 1.1
Category: How-tos

Displaying image in a CGridView column.

Created 13 years ago by sirin k, updated 8 years ago by Maurizio Domba Cerin.

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.

9 1
14 followers
Viewed: 76 291 times
Version: 1.1
Category: How-tos

Create custom button button with AJAX function in CGridView

Created 12 years ago by nkd, updated 12 years ago by nkd.

This will call the controller function using AJAX instead of redirecting the user to the url using GET parameters.

5 0
15 followers
Viewed: 68 834 times
Version: 1.1
Category: How-tos

Limit a CGridView field to some preset length.

Created 12 years ago by le_top, updated 12 years ago by le_top.

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.

9 0
9 followers
Viewed: 23 710 times
Version: 1.1
Category: How-tos

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

Created 12 years ago by Maug Lee, updated 11 years ago by yugene.

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.

Implementation

<?php
$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dat...
7 0
4 followers
Viewed: 55 904 times
Version: 1.1
Category: How-tos

multiple CActiveDataProviders in one CGridView

Created 12 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Nashi.

There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?

4 1
9 followers
Viewed: 33 811 times
Version: 1.1
Category: How-tos

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

Created 12 years ago by VINAY Kr. SHARMA, updated 9 years ago by VINAY Kr. SHARMA.

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

3 0
12 followers
Viewed: 32 407 times
Version: 1.1
Category: How-tos

Insert a multirow header in CGridView

Created 11 years ago by Peppe, updated 10 years ago by Peppe.

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

4 0
5 followers
Viewed: 28 630 times
Version: 1.1
Category: How-tos

CGridView Date Range Without Cookies or Session (External Filtering)

Created 11 years ago by ezekielnoob, updated 10 years ago by ezekielnoob.

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: grid

3 0
8 followers
Viewed: 22 368 times
Version: 1.1
Category: How-tos