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 @@
/**
* beforeFilter event is triggered before filtering the grid.
* The signature of the event handler should be:
* function (event, form)
* function (event)
* where
* - 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
* a result, afterFilter event will not be triggered.
......@@ -45,10 +44,9 @@
/**
* afterFilter event is triggered after filtering the grid and filtered results are fetched.
* The signature of the event handler should be:
* function (event, form)
* function (event)
* where
* - event: an Event object.
* - form: is the grid filter form that will be submitted
*/
afterFilter: 'afterFilter.yiiGridView'
};
......@@ -109,7 +107,7 @@
// triggers `beforeFilter` grid event with the filter form as a parameter
event = $.Event(gridEvents.beforeFilter);
$grid.trigger(event, [$form]);
$grid.trigger(event);
if (event.result === false) {
return;
}
......@@ -118,7 +116,7 @@
// triggers `afterFilter` grid event with the filter form as a parameter
event = $.Event(gridEvents.afterFilter);
$grid.trigger(event, [$form]);
$grid.trigger(event);
},
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