grid_table 1.5.4 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/grid_table/version.rb +1 -1
- data/vendor/assets/javascripts/gridtable.js +35 -4
- 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: cdb45bba0073b01501c1f11a0bfb8cf691ca28d9
|
4
|
+
data.tar.gz: b6d457e8acf036318b04ff03670ecf762af9ad0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed16f61616434ed4b73e041b1f70531757a381b0dfc3ac506a2cc13630ce3f571dce1edd8b08e4aee0c1e7ad327fdb55b7f507301ca6b766a27b667124140681
|
7
|
+
data.tar.gz: 0be8b3ee3acc620e115e5e117401fcfcaab0c74c86bcbf8041994bbff4a2041483dd8299683b4d8f224908a3c25c9674884d0b1efb5eed909770f9230b57b075
|
data/lib/grid_table/version.rb
CHANGED
@@ -123,20 +123,42 @@ GridTable = (function() {
|
|
123
123
|
});
|
124
124
|
};
|
125
125
|
})(this));
|
126
|
-
|
126
|
+
|
127
|
+
var dataFilterSelector = "[data-grid-table-id='" + this.gridTableParams.getId() + "'][data-filter]";
|
128
|
+
$("select" + dataFilterSelector).each((function (_this) {
|
127
129
|
return function(index, filter) {
|
130
|
+
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
128
131
|
return $(filter).on("change", function(event) {
|
129
132
|
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
130
133
|
return _this.loadData();
|
131
134
|
});
|
132
135
|
};
|
133
136
|
})(this));
|
134
|
-
|
137
|
+
|
138
|
+
// find non-selectable inputs
|
139
|
+
$("input:not([type=radio], [type=checkbox])" + dataFilterSelector).each((function (_this) {
|
140
|
+
return function (index, filter) {
|
141
|
+
var timeout;
|
142
|
+
timeout = null;
|
143
|
+
return $(filter).on("propertychange keyup input paste", function (event) {
|
144
|
+
clearTimeout(timeout);
|
145
|
+
return timeout = setTimeout((function () {
|
146
|
+
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
147
|
+
return _this.loadData();
|
148
|
+
}), 500);
|
149
|
+
});
|
150
|
+
};
|
151
|
+
})(this));
|
152
|
+
|
153
|
+
$("input:radio" + dataFilterSelector + ",input:checkbox" + dataFilterSelector).each((function (_this) {
|
135
154
|
return function(index, filter) {
|
136
155
|
var timeout;
|
137
|
-
|
156
|
+
// only setFilter for radio && checkbox inputs if they are also checked
|
157
|
+
if (filter.checked) {
|
158
|
+
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
159
|
+
}
|
138
160
|
timeout = null;
|
139
|
-
return $(filter).on("
|
161
|
+
return $(filter).on("change", function(event) {
|
140
162
|
clearTimeout(timeout);
|
141
163
|
return timeout = setTimeout((function() {
|
142
164
|
_this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
|
@@ -145,6 +167,7 @@ GridTable = (function() {
|
|
145
167
|
});
|
146
168
|
};
|
147
169
|
})(this));
|
170
|
+
|
148
171
|
this.gridTableDOM.find('#pagesize, .pagesize').each((function(_this) {
|
149
172
|
return function(index, elem) {
|
150
173
|
var pageSizeSelect, size, _i, _len, _ref;
|
@@ -190,6 +213,10 @@ GridTable = (function() {
|
|
190
213
|
return this.gridTableParams.setId(id);
|
191
214
|
};
|
192
215
|
|
216
|
+
GridTable.prototype.getId = function () {
|
217
|
+
return this.gridTableParams.getId();
|
218
|
+
};
|
219
|
+
|
193
220
|
GridTable.prototype.setUrl = function(url) {
|
194
221
|
return this.gridTableParams.setUrl(url);
|
195
222
|
};
|
@@ -487,6 +514,10 @@ GridTable = (function() {
|
|
487
514
|
return this.id = id;
|
488
515
|
};
|
489
516
|
|
517
|
+
GridTableParams.prototype.getId = function () {
|
518
|
+
return this.id;
|
519
|
+
};
|
520
|
+
|
490
521
|
GridTableParams.prototype.setUrl = function(url) {
|
491
522
|
return this.url = url;
|
492
523
|
};
|
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.
|
4
|
+
version: 1.6.0
|
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-
|
12
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|