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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
cd1152ac
Commit
cd1152ac
authored
Apr 22, 2014
by
Ivan Kolmycheck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GridView/DataColumn - moved error list display into GridView
parent
031fddd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
GridView.php
framework/grid/GridView.php
+24
-1
BaseListView.php
framework/widgets/BaseListView.php
+1
-13
No files found.
framework/grid/GridView.php
View file @
cd1152ac
...
...
@@ -15,6 +15,8 @@ use yii\helpers\Url;
use
yii\helpers\Html
;
use
yii\helpers\Json
;
use
yii\widgets\BaseListView
;
use
yii\helpers\ArrayHelper
;
use
yii\base\Model
;
/**
* The GridView widget is used to display data in a grid.
...
...
@@ -174,6 +176,17 @@ class GridView extends BaseListView
*/
public
$filterRowOptions
=
[
'class'
=>
'filters'
];
/**
* @var string the layout that determines how different sections of the list view should be organized.
* The following tokens will be replaced with the corresponding section contents:
*
* - `{summary}`: the summary section. See [[renderSummary()]].
* - `{error}`: the filter model errors. See [[renderErrors()]].
* - `{items}`: the list items. See [[renderItems()]].
* - `{sorter}`: the sorter. See [[renderSorter()]].
* - `{pager}`: the pager. See [[renderPager()]].
*/
public
$layout
=
"
{
summary}\n{errors}\n{items}\n{pager
}
"
;
/**
* Initializes the grid view.
...
...
@@ -228,7 +241,17 @@ class GridView extends BaseListView
return
Html
::
tag
(
'div'
,
Html
::
ul
(
$errorsList
,
[
'class'
=>
'help-block'
]),
[
'class'
=>
'has-error'
]);
}
return
parent
::
renderErrors
();
return
''
;
}
public
function
renderSection
(
$name
)
{
switch
(
$name
)
{
case
"
{
errors
}
"
:
return
$this
->
renderErrors
();
default
:
return
parent
::
renderSection
(
$name
);
}
}
/**
...
...
framework/widgets/BaseListView.php
View file @
cd1152ac
...
...
@@ -78,12 +78,11 @@ abstract class BaseListView extends Widget
* The following tokens will be replaced with the corresponding section contents:
*
* - `{summary}`: the summary section. See [[renderSummary()]].
* - `{errors}`: the errors section. See [[renderErrors()]].
* - `{items}`: the list items. See [[renderItems()]].
* - `{sorter}`: the sorter. See [[renderSorter()]].
* - `{pager}`: the pager. See [[renderPager()]].
*/
public
$layout
=
"
{
summary}\n{
errors}\n{
items}\n{pager
}
"
;
public
$layout
=
"
{
summary}\n{items}\n{pager
}
"
;
/**
* Renders the data models.
...
...
@@ -92,15 +91,6 @@ abstract class BaseListView extends Widget
abstract
public
function
renderItems
();
/**
* Renders the list of errors, if there are any
* @return string the rendering result
*/
public
function
renderErrors
()
{
return
''
;
}
/**
* Initializes the view.
*/
public
function
init
()
...
...
@@ -141,8 +131,6 @@ abstract class BaseListView extends Widget
public
function
renderSection
(
$name
)
{
switch
(
$name
)
{
case
'{errors}'
:
return
$this
->
renderErrors
();
case
'{summary}'
:
return
$this
->
renderSummary
();
case
'{items}'
:
...
...
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