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
f8dc796d
Commit
f8dc796d
authored
Sep 21, 2014
by
Kartik Visweswaran
Committed by
Qiang Xue
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified beforeFilter and afterFilter events
Removed `form` as a parameter to the events since it can be retrieved using `$grid.find('form.gridview-filter-form')`.
parent
4bd8a8c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
yii.gridView.js
framework/assets/yii.gridView.js
+4
-6
No files found.
framework/assets/yii.gridView.js
View file @
f8dc796d
...
@@ -33,10 +33,9 @@
...
@@ -33,10 +33,9 @@
/**
/**
* beforeFilter event is triggered before filtering the grid.
* beforeFilter event is triggered before filtering the grid.
* The signature of the event handler should be:
* The signature of the event handler should be:
* function (event
, form
)
* function (event)
* where
* where
* - event: an Event object.
* - event: an Event object.
* - form: is the grid filter form that will be submitted
*
*
* If the handler returns a boolean false, it will stop filter form submission after this event. And as
* If the handler returns a boolean false, it will stop filter form submission after this event. And as
* a result, afterFilter event will not be triggered.
* a result, afterFilter event will not be triggered.
...
@@ -45,10 +44,9 @@
...
@@ -45,10 +44,9 @@
/**
/**
* afterFilter event is triggered after filtering the grid and filtered results are fetched.
* afterFilter event is triggered after filtering the grid and filtered results are fetched.
* The signature of the event handler should be:
* The signature of the event handler should be:
* function (event
, form
)
* function (event)
* where
* where
* - event: an Event object.
* - event: an Event object.
* - form: is the grid filter form that will be submitted
*/
*/
afterFilter
:
'afterFilter.yiiGridView'
afterFilter
:
'afterFilter.yiiGridView'
};
};
...
@@ -109,7 +107,7 @@
...
@@ -109,7 +107,7 @@
// triggers `beforeFilter` grid event with the filter form as a parameter
// triggers `beforeFilter` grid event with the filter form as a parameter
event
=
$
.
Event
(
gridEvents
.
beforeFilter
);
event
=
$
.
Event
(
gridEvents
.
beforeFilter
);
$grid
.
trigger
(
event
,
[
$form
]
);
$grid
.
trigger
(
event
);
if
(
event
.
result
===
false
)
{
if
(
event
.
result
===
false
)
{
return
;
return
;
}
}
...
@@ -118,7 +116,7 @@
...
@@ -118,7 +116,7 @@
// triggers `afterFilter` grid event with the filter form as a parameter
// triggers `afterFilter` grid event with the filter form as a parameter
event
=
$
.
Event
(
gridEvents
.
afterFilter
);
event
=
$
.
Event
(
gridEvents
.
afterFilter
);
$grid
.
trigger
(
event
,
[
$form
]
);
$grid
.
trigger
(
event
);
},
},
setSelectionColumn
:
function
(
options
)
{
setSelectionColumn
:
function
(
options
)
{
...
...
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