Fixes #16365: Added $filterOnFocusOut option for GridView

This commit is contained in:
Evgeniy Moiseenko
2018-07-04 21:42:40 +03:00
committed by Alexander Makarov
parent a5c8b215b3
commit 80d0c2b05a
4 changed files with 21 additions and 8 deletions

View File

@ -14,7 +14,7 @@
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist in jQuery.yiiGridView');
return false;
@ -23,7 +23,8 @@
var defaults = {
filterUrl: undefined,
filterSelector: undefined
filterSelector: undefined,
filterOnFocusOut: true
};
var gridData = {};
@ -82,6 +83,9 @@
var $e = $(this);
var settings = $.extend({}, defaults, options || {});
var id = $e.attr('id');
if (!settings.filterOnFocusOut) {
return false;
}
if (gridData[id] === undefined) {
gridData[id] = {};
}