Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-giiant
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
yii2-giiant
Commits
3dac6dc7
Commit
3dac6dc7
authored
Nov 03, 2016
by
Tobias Munk
Committed by
GitHub
Nov 03, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #186 from marc7000/patch-1
Added color column example
parents
16d7eb14
6cea5205
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
31-callback-provider-examples.md
docs/31-callback-provider-examples.md
+15
-0
No files found.
docs/31-callback-provider-examples.md
View file @
3dac6dc7
...
...
@@ -103,6 +103,21 @@ $columnFormats = [
];
```
Renders a color column
```
php
$colorColumn
=
function
(
$attribute
,
$model
,
$generator
)
{
return
<<<FORMAT
[
'attribute' => '{$attribute}',
'format' => 'raw',
'value' => function (\$model) {
return \yii\helpers\Html::tag('div', '', ['style' => 'background-color: '.\$model->{$attribute}.'; width: 30px; height: 30px;']);
},
]
FORMAT;
};
```
Define callbacks for grid columns in
`index`
view
...
...
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