回答編集履歴
2
codepen
test
CHANGED
@@ -227,3 +227,7 @@
|
|
227
227
|
|
228
228
|
|
229
229
|
```
|
230
|
+
|
231
|
+
# codepen
|
232
|
+
|
233
|
+
- [codepen](https://codepen.io/yambejp/pen/QeWjxb)
|
1
chousei
test
CHANGED
@@ -165,3 +165,65 @@
|
|
165
165
|
</table>
|
166
166
|
|
167
167
|
```
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
# 調整版
|
172
|
+
|
173
|
+
```javascript
|
174
|
+
|
175
|
+
$(function() {
|
176
|
+
|
177
|
+
$("input").on("input change", function() {
|
178
|
+
|
179
|
+
var gender = $("[name=search_gender]:checked").map(function() {
|
180
|
+
|
181
|
+
return $(this).val();
|
182
|
+
|
183
|
+
}).get();
|
184
|
+
|
185
|
+
var dept = $("[name=search_dept]:checked").map(function() {
|
186
|
+
|
187
|
+
return $(this).val();
|
188
|
+
|
189
|
+
}).get();
|
190
|
+
|
191
|
+
var name = $("#search-text").val();
|
192
|
+
|
193
|
+
$("#abcd tbody tr").each(function() {
|
194
|
+
|
195
|
+
var reg=new RegExp(name);
|
196
|
+
|
197
|
+
if ($.inArray($(this).find("td.All_emp_gender").text(),gender) >= 0 &&
|
198
|
+
|
199
|
+
$.inArray( $(this).find("td.All_dept_name").text(),dept) >= 0 &&
|
200
|
+
|
201
|
+
(name=="" ||
|
202
|
+
|
203
|
+
reg.test($(this).find("td.All_emp_name").text()) ||
|
204
|
+
|
205
|
+
reg.test($(this).find("td.All_emp_gender").text()) ||
|
206
|
+
|
207
|
+
reg.test($(this).find("td.All_dept_name").text()) )
|
208
|
+
|
209
|
+
){
|
210
|
+
|
211
|
+
$(this).show();
|
212
|
+
|
213
|
+
} else {
|
214
|
+
|
215
|
+
$(this).hide();
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
});
|
220
|
+
|
221
|
+
});
|
222
|
+
|
223
|
+
$(":checkbox").prop("checked", true).eq(0).trigger('change');
|
224
|
+
|
225
|
+
});
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
```
|