Wiki

Articles tagged with "cgridview", sorted by commentsX
Displaying 31-40 of 65 result(s).

Take more control of CGridview and model searching (related model or another controller)

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos5 comments – viewed 28,715 times – ( +5 ) – version 1.1
Suppose you have an Application in Yii that manages hotels each one has many customers.

Saving CGridView filter

Created 2 years ago by sefburhanTutorials5 comments – viewed 6,991 times – ( +27 ) – version 1.1
In this tutorial we will try to save cgridview filter(search) with title etc. basically we want to save two forms data i.e one represents filters and other data about filters like title, description etc. You can define your own structure for filter saving table here are some basic steps

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

Created 3 years ago by bluezedTutorials5 comments – viewed 29,139 times – ( +10 / -1 ) – version 1.1
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:

CGridView keep focus on the control after filtering

Created 4 years ago by jayalaHow-tos4 comments – viewed 9,894 times – ( +6 ) – version 1.1
You can find the reason why I wrote this article here.
tags: CGridView, filter

Customize CGridView columns directly in your view

Created 3 years ago by clapasTips4 comments – viewed 29,849 times – ( +3 / -2 ) – version 1.1
You usually take a model instance passed into your view to provide data to a CGridView in this way:

Using standard filters in CGridView custom fields

Created 5 years ago by GOshaHow-tos4 comments – viewed 60,051 times – ( +17 ) – version 1.1
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:

Keeping a running total in a CGridView

Created 5 years ago by Steve FriedlHow-tos4 comments – viewed 29,941 times – ( +24 ) – version 1.1
This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!
tags: CGridView

How to keep filters simple in CGridView

Created about a year ago by PeppeHow-tos3 comments – viewed 4,950 times – version 1.1
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.

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 4 years ago by c@cbaTutorials3 comments – viewed 57,455 times – ( +28 / -1 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

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

Created 3 years ago by Xgamer99Tips3 comments – viewed 12,953 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.