grid_table 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grid_table/version.rb +1 -1
- data/vendor/assets/javascripts/gridtable.js +24 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e49713f15732a6342839fbb76a455fc844e9e8b0
|
4
|
+
data.tar.gz: fb0ccace4cecad020a666978a828a952408b2944
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 843e4b5ab3055808b4106844e433215ff924c3fcf4ea9422306cf773625913955a26e58d99704c3a7a3aaf4cfc7b46f9b32b973e5d618cd581b412518ebc039f
|
7
|
+
data.tar.gz: 984165e174c880a8f70d78ede133933d0cc88e9f935886d0860e927b73ed2fda67396f5e2496d6af7567f08be32fad041cad77d14eee46cb3648f82e61331a27
|
data/lib/grid_table/version.rb
CHANGED
@@ -123,10 +123,12 @@ GridTable = (function() {
|
|
123
123
|
});
|
124
124
|
};
|
125
125
|
})(this));
|
126
|
+
|
126
127
|
var dataFilterSelector = "[data-filter]";
|
128
|
+
|
127
129
|
$("select" + dataFilterSelector).each((function (_this) {
|
128
130
|
return function (index, filter) {
|
129
|
-
if (
|
131
|
+
if (_this.gridTableParams.includeFilter(filter)) {
|
130
132
|
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
131
133
|
return $(filter).on("change", function (event) {
|
132
134
|
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
@@ -139,7 +141,7 @@ GridTable = (function() {
|
|
139
141
|
// find non-selectable inputs
|
140
142
|
$("input:not([type=radio], [type=checkbox])" + dataFilterSelector).each((function (_this) {
|
141
143
|
return function (index, filter) {
|
142
|
-
if (
|
144
|
+
if (_this.gridTableParams.includeFilter(filter)) {
|
143
145
|
var timeout;
|
144
146
|
timeout = null;
|
145
147
|
return $(filter).on("propertychange keyup input paste", function (event) {
|
@@ -155,19 +157,21 @@ GridTable = (function() {
|
|
155
157
|
|
156
158
|
$("input:radio" + dataFilterSelector + ",input:checkbox" + dataFilterSelector).each((function (_this) {
|
157
159
|
return function(index, filter) {
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
}
|
163
|
-
timeout = null;
|
164
|
-
return $(filter).on("change", function(event) {
|
165
|
-
clearTimeout(timeout);
|
166
|
-
return timeout = setTimeout((function() {
|
160
|
+
if (_this.gridTableParams.includeFilter(filter)) {
|
161
|
+
var timeout;
|
162
|
+
// only setFilter for radio && checkbox inputs if they are also checked
|
163
|
+
if (filter.checked) {
|
167
164
|
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
168
|
-
|
169
|
-
|
170
|
-
|
165
|
+
}
|
166
|
+
timeout = null;
|
167
|
+
return $(filter).on("change", function(event) {
|
168
|
+
clearTimeout(timeout);
|
169
|
+
return timeout = setTimeout((function() {
|
170
|
+
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
171
|
+
return _this.loadData();
|
172
|
+
}), 500);
|
173
|
+
});
|
174
|
+
}
|
171
175
|
};
|
172
176
|
})(this));
|
173
177
|
|
@@ -554,6 +558,12 @@ GridTable = (function() {
|
|
554
558
|
}
|
555
559
|
};
|
556
560
|
|
561
|
+
GridTableParams.prototype.includeFilter = function (filter) {
|
562
|
+
var gridTableIds = $(filter).data('grid-table-id');
|
563
|
+
|
564
|
+
return $.inArray(this.id, gridTableIds.split(','));
|
565
|
+
}
|
566
|
+
|
557
567
|
GridTableParams.prototype.buildUrl = function(baseUrl, skip_paging) {
|
558
568
|
var k, url, v, _ref;
|
559
569
|
if (skip_paging == null) {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grid_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Principe
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-10-
|
12
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|