Commit 4fffe479 by Antonio Ramirez

fix formatting

parent ea90ac1a
...@@ -26,17 +26,17 @@ ...@@ -26,17 +26,17 @@
filterSelector: undefined filterSelector: undefined
}; };
var gridData = {}; var gridData = {};
var methods = { var methods = {
init: function (options) { init: function (options) {
return this.each(function () { return this.each(function () {
var $e = $(this); var $e = $(this);
var settings = $.extend({}, defaults, options || {}); var settings = $.extend({}, defaults, options || {});
gridData.settings = settings; gridData.settings = settings;
var enterPressed = false; var enterPressed = false;
$(document).on('change.yiiGridView keydown.yiiGridView', settings.filterSelector, function (event) { $(document).on('change.yiiGridView keydown.yiiGridView', settings.filterSelector, function (event) {
if (event.type === 'keydown') { if (event.type === 'keydown') {
if (event.keyCode !== 13) { if (event.keyCode !== 13) {
return; // only react to enter key return; // only react to enter key
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
applyFilter: function () { applyFilter: function () {
var $grid = $(this); var $grid = $(this);
var settings = gridData.settings; var settings = gridData.settings;
var data = {}; var data = {};
$.each($(settings.filterSelector).serializeArray(), function () { $.each($(settings.filterSelector).serializeArray(), function () {
data[this.name] = this.value; data[this.name] = this.value;
...@@ -85,16 +85,16 @@ ...@@ -85,16 +85,16 @@
setSelectionColumn: function (options) { setSelectionColumn: function (options) {
var $grid = $(this); var $grid = $(this);
var id = $(this).prop('id'); var id = $(this).prop('id');
gridData.selectionColumn = options.name; gridData.selectionColumn = options.name;
if (!options.multiple) { if (!options.multiple) {
return; return;
} }
var inputs = "#" + id + " input[name='" + options.checkAll + "']"; var inputs = "#" + id + " input[name='" + options.checkAll + "']";
$(document).off('click.yiiGridView', inputs ).on('click.yiiGridView', inputs, function () { $(document).off('click.yiiGridView', inputs ).on('click.yiiGridView', inputs, function () {
$grid.find("input[name='" + options.name + "']:enabled").prop('checked', this.checked); $grid.find("input[name='" + options.name + "']:enabled").prop('checked', this.checked);
}); });
$(document).off('click.yiiGridView', inputs + ":enabled").on('click.yiiGridView', inputs + ":enabled", function () { $(document).off('click.yiiGridView', inputs + ":enabled").on('click.yiiGridView', inputs + ":enabled", function () {
var all = $grid.find("input[name='" + options.name + "']").length == $grid.find("input[name='" + options.name + "']:checked").length; var all = $grid.find("input[name='" + options.name + "']").length == $grid.find("input[name='" + options.name + "']:checked").length;
$grid.find("input[name='" + options.checkAll + "']").prop('checked', all); $grid.find("input[name='" + options.checkAll + "']").prop('checked', all);
}); });
......
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