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
bb4e8eb7
Commit
bb4e8eb7
authored
Apr 22, 2014
by
Ivan Kolmycheck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataColumn - error detection moved into renderFilterCellContent()
parent
cd1152ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
24 deletions
+3
-24
DataColumn.php
framework/grid/DataColumn.php
+3
-24
No files found.
framework/grid/DataColumn.php
View file @
bb4e8eb7
...
@@ -143,6 +143,9 @@ class DataColumn extends Column
...
@@ -143,6 +143,9 @@ class DataColumn extends Column
return
$this
->
filter
;
return
$this
->
filter
;
}
elseif
(
$this
->
filter
!==
false
&&
$this
->
grid
->
filterModel
instanceof
Model
&&
}
elseif
(
$this
->
filter
!==
false
&&
$this
->
grid
->
filterModel
instanceof
Model
&&
$this
->
attribute
!==
null
&&
$this
->
grid
->
filterModel
->
isAttributeActive
(
$this
->
attribute
))
{
$this
->
attribute
!==
null
&&
$this
->
grid
->
filterModel
->
isAttributeActive
(
$this
->
attribute
))
{
if
(
$this
->
grid
->
filterModel
->
hasErrors
(
$this
->
attribute
))
{
Html
::
addCssClass
(
$this
->
filterOptions
,
'has-error'
);
}
if
(
is_array
(
$this
->
filter
))
{
if
(
is_array
(
$this
->
filter
))
{
$options
=
array_merge
([
'prompt'
=>
''
],
$this
->
filterInputOptions
);
$options
=
array_merge
([
'prompt'
=>
''
],
$this
->
filterInputOptions
);
return
Html
::
activeDropDownList
(
$this
->
grid
->
filterModel
,
$this
->
attribute
,
$this
->
filter
,
$options
);
return
Html
::
activeDropDownList
(
$this
->
grid
->
filterModel
,
$this
->
attribute
,
$this
->
filter
,
$options
);
...
@@ -182,28 +185,4 @@ class DataColumn extends Column
...
@@ -182,28 +185,4 @@ class DataColumn extends Column
return
parent
::
renderDataCellContent
(
$model
,
$key
,
$index
);
return
parent
::
renderDataCellContent
(
$model
,
$key
,
$index
);
}
}
}
}
/**
* Checks for filter errors and sets up an indication if there are any
*/
public
function
checkForFilterErrors
()
{
if
(
$this
->
filter
!==
false
&&
$this
->
grid
->
filterModel
instanceof
Model
&&
$this
->
attribute
!==
null
&&
$this
->
grid
->
filterModel
->
isAttributeActive
(
$this
->
attribute
)
&&
ArrayHelper
::
keyExists
(
$this
->
attribute
,
$this
->
grid
->
filterModel
->
errors
)
)
{
Html
::
addCssClass
(
$this
->
filterOptions
,
'has-error'
);
}
}
/**
* @inheritdoc
*/
public
function
renderFilterCell
()
{
$this
->
checkForFilterErrors
();
return
parent
::
renderFilterCell
();
}
}
}
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