Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
3bc5dbed
Commit
3bc5dbed
authored
Feb 02, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added doc example to gridview column classes
fixes #2276
parent
a90f2f21
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
4 deletions
+41
-4
ActionColumn.php
framework/grid/ActionColumn.php
+12
-0
CheckboxColumn.php
framework/grid/CheckboxColumn.php
+13
-0
GridView.php
framework/grid/GridView.php
+4
-4
SerialColumn.php
framework/grid/SerialColumn.php
+12
-0
No files found.
framework/grid/ActionColumn.php
View file @
3bc5dbed
...
@@ -14,6 +14,18 @@ use yii\helpers\Html;
...
@@ -14,6 +14,18 @@ use yii\helpers\Html;
/**
/**
* ActionColumn is a column for the [[GridView]] widget that displays buttons for viewing and manipulating the items.
* ActionColumn is a column for the [[GridView]] widget that displays buttons for viewing and manipulating the items.
*
*
* To add an ActionColumn to the gridview, add it to the [[GridView::columns|columns]] configuration as follows:
*
* ```php
* 'columns' => [
* // ...
* [
* 'class' => 'yii\grid\ActionColumn',
* // you may configure additional properties here
* ],
* ]
* ```
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
...
...
framework/grid/CheckboxColumn.php
View file @
3bc5dbed
...
@@ -13,6 +13,19 @@ use yii\helpers\Html;
...
@@ -13,6 +13,19 @@ use yii\helpers\Html;
/**
/**
* CheckboxColumn displays a column of checkboxes in a grid view.
* CheckboxColumn displays a column of checkboxes in a grid view.
*
* * To add a CheckboxColumn to the [[GridView]], add it to the [[GridView::columns|columns]] configuration as follows:
*
* ```php
* 'columns' => [
* // ...
* [
* 'class' => 'yii\grid\CheckboxColumn',
* // you may configure additional properties here
* ],
* ]
* ```
*
* Users may click on the checkboxes to select rows of the grid. The selected rows may be
* Users may click on the checkboxes to select rows of the grid. The selected rows may be
* obtained by calling the following JavaScript code:
* obtained by calling the following JavaScript code:
*
*
...
...
framework/grid/GridView.php
View file @
3bc5dbed
...
@@ -67,9 +67,9 @@ class GridView extends BaseListView
...
@@ -67,9 +67,9 @@ class GridView extends BaseListView
* returns an array of the HTML attributes. The anonymous function will be called once for every
* returns an array of the HTML attributes. The anonymous function will be called once for every
* data model returned by [[dataProvider]]. It should have the following signature:
* data model returned by [[dataProvider]]. It should have the following signature:
*
*
*
~~~
php
*
```
php
* function ($model, $key, $index, $grid)
* function ($model, $key, $index, $grid)
*
~~~
*
```
*
*
* - `$model`: the current data model being rendered
* - `$model`: the current data model being rendered
* - `$key`: the key value associated with the current data model
* - `$key`: the key value associated with the current data model
...
@@ -111,7 +111,7 @@ class GridView extends BaseListView
...
@@ -111,7 +111,7 @@ class GridView extends BaseListView
* @var array grid column configuration. Each array element represents the configuration
* @var array grid column configuration. Each array element represents the configuration
* for one particular grid column. For example,
* for one particular grid column. For example,
*
*
*
~~~
php
*
```
php
* [
* [
* ['class' => SerialColumn::className()],
* ['class' => SerialColumn::className()],
* [
* [
...
@@ -122,7 +122,7 @@ class GridView extends BaseListView
...
@@ -122,7 +122,7 @@ class GridView extends BaseListView
* ],
* ],
* ['class' => CheckboxColumn::className()],
* ['class' => CheckboxColumn::className()],
* ]
* ]
*
~~~
*
```
*
*
* If a column is of class [[DataColumn]], the "class" element can be omitted.
* If a column is of class [[DataColumn]], the "class" element can be omitted.
*
*
...
...
framework/grid/SerialColumn.php
View file @
3bc5dbed
...
@@ -10,6 +10,18 @@ namespace yii\grid;
...
@@ -10,6 +10,18 @@ namespace yii\grid;
/**
/**
* SerialColumn displays a column of row numbers (1-based).
* SerialColumn displays a column of row numbers (1-based).
*
*
* To add a SerialColumn to the [[GridView]], add it to the [[GridView::columns|columns]] configuration as follows:
*
* ```php
* 'columns' => [
* // ...
* [
* 'class' => 'yii\grid\SerialColumn',
* // you may configure additional properties here
* ],
* ]
* ```
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment