Commit f8dc796d by Kartik Visweswaran Committed by Qiang Xue

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
...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment