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
1c1dcc2c
Commit
1c1dcc2c
authored
Jun 25, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed gridview documentation
fixes #4045
parent
6578cfbd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
output-data-widgets.md
docs/guide/output-data-widgets.md
+4
-4
Column.php
framework/grid/Column.php
+5
-3
DataColumn.php
framework/grid/DataColumn.php
+1
-1
No files found.
docs/guide/output-data-widgets.md
View file @
1c1dcc2c
...
...
@@ -122,11 +122,11 @@ grid columns.
-
`visible`
is the column should be visible.
-
`content`
allows you to pass a valid PHP callback that will return data for a row. The format is the following:
```
php
function
(
$model
,
$key
,
$index
,
$grid
)
{
```
php
function
(
$model
,
$key
,
$index
,
$column
)
{
return
'a string'
;
}
```
}
```
You may specify various container HTML options passing arrays to:
...
...
framework/grid/Column.php
View file @
1c1dcc2c
...
...
@@ -32,7 +32,8 @@ class Column extends Object
*/
public
$footer
;
/**
* @var callable
* @var callable This is a callable that will be used to generated the content of each cell.
* The signature of the function should be the following: `function ($model, $key, $index, $column)`.
*/
public
$content
;
/**
...
...
@@ -51,8 +52,8 @@ class Column extends Object
public
$headerOptions
=
[];
/**
* @var array|\Closure the HTML attributes for the data cell tag. This can either be an array of
* attributes or an anonymous function
that
([[Closure]]) that returns such an array.
* The signature of the function should be the following: `function ($model, $key, $index, $
gridView
)`.
* attributes or an anonymous function ([[Closure]]) that returns such an array.
* The signature of the function should be the following: `function ($model, $key, $index, $
column
)`.
* A function may be used to assign different attributes to different rows based on the data in that row.
*
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
...
...
@@ -69,6 +70,7 @@ class Column extends Object
*/
public
$filterOptions
=
[];
/**
* Renders the header cell.
*/
...
...
framework/grid/DataColumn.php
View file @
1c1dcc2c
...
...
@@ -51,7 +51,7 @@ class DataColumn extends Column
public
$label
;
/**
* @var string|\Closure an anonymous function that returns the value to be displayed for every data model.
* The signature of this function is `function ($model, $key, $index, $
widget
)`.
* The signature of this function is `function ($model, $key, $index, $
column
)`.
* If this is not set, `$model[$attribute]` will be used to obtain the value.
*
* You may also set this property to a string representing the attribute name to be displayed in this column.
...
...
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