質問編集履歴
4
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -344,7 +344,7 @@
|
|
344
344
|
|
345
345
|
}
|
346
346
|
|
347
|
-
if($(this).hasclass('c
|
347
|
+
if($(this).hasclass('collect')==true){
|
348
348
|
|
349
349
|
endrow+=1;
|
350
350
|
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -327,3 +327,33 @@
|
|
327
327
|
|
328
328
|
|
329
329
|
無知で申し訳ありませんがどうか、力をお貸しください。
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
追記:↓の方法では駄目でした
|
334
|
+
|
335
|
+
```jquery
|
336
|
+
|
337
|
+
//変数の宣言はしてあります。
|
338
|
+
|
339
|
+
$("cs-showb").each(function(){
|
340
|
+
|
341
|
+
if($(this).hasclass('cs-serected')==true){
|
342
|
+
|
343
|
+
strow=i;
|
344
|
+
|
345
|
+
}
|
346
|
+
|
347
|
+
if($(this).hasclass('cs-serected')==true){
|
348
|
+
|
349
|
+
endrow+=1;
|
350
|
+
|
351
|
+
}
|
352
|
+
|
353
|
+
i+=1;
|
354
|
+
|
355
|
+
});
|
356
|
+
|
357
|
+
objList1.splice(strow,strow+endrow);
|
358
|
+
|
359
|
+
```
|
2
a
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,58 +10,320 @@
|
|
10
10
|
|
11
11
|
そのオブジェクト配列をajaxでサーバ側にデータを送って登録する為です。
|
12
12
|
|
13
|
-
|
13
|
+
入力フォームは
|
14
|
+
|
15
|
+
```html
|
16
|
+
|
17
|
+
<script type="text/template" id="modal">
|
18
|
+
|
19
|
+
<div>
|
20
|
+
|
21
|
+
<div class="col-md-3 col-sm-6 pd_num" data-p1="" data-id="">
|
22
|
+
|
23
|
+
<h4>q</h4>
|
24
|
+
|
25
|
+
<p><input type="text" id="pnum" name="num"></p>
|
26
|
+
|
27
|
+
<p><button class="pdnseh" type="button" data-no="1">検索</button></p>
|
28
|
+
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="col-md-2 col-sm-6">
|
32
|
+
|
33
|
+
<h4>w</h4>
|
34
|
+
|
35
|
+
<p><input type="text" id="model" name="model" readonly></p>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="col-md-4 col-sm-6">
|
40
|
+
|
41
|
+
<h4>e</h4>
|
42
|
+
|
43
|
+
<p><input type="text" id="name" name="name" readonly></p>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div class="col-md-3 col-sm-6">
|
48
|
+
|
49
|
+
<h4>r</h4>
|
50
|
+
|
51
|
+
<p><input type="text" id="pt" name="pt" readonly></p>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
<div>区分
|
60
|
+
|
61
|
+
<form id="dispopr" class="dispopr cs-center" >
|
62
|
+
|
63
|
+
<span style="margin-right:20px;">
|
64
|
+
|
65
|
+
<input type="radio" value="1" name="dpor">1
|
66
|
+
|
67
|
+
</span>
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<span style="margin-right:20px;">
|
72
|
+
|
73
|
+
<input type="radio" value="2" name="dpor">2
|
74
|
+
|
75
|
+
</span>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<span style="margin-right:20px;">
|
80
|
+
|
81
|
+
<input type="radio" value="3" name="dpor">3
|
82
|
+
|
83
|
+
</span>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
<span style="margin-right:20px;">
|
88
|
+
|
89
|
+
<input type="radio" value="4" name="dpor">4
|
90
|
+
|
91
|
+
</span>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<span style="margin-right:20px;">
|
96
|
+
|
97
|
+
<input type="radio" value="C" name="dpor">C
|
98
|
+
|
99
|
+
</span>
|
100
|
+
|
101
|
+
</form>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<div>
|
108
|
+
|
109
|
+
<div class="col-md-3 col-sm-5">
|
110
|
+
|
111
|
+
<h4>a</h4>
|
112
|
+
|
113
|
+
<p><select class="form-control input-sm wcont" id="kme" name="kme" style="width:80%;"></select></p>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div class="col-md-2 col-sm-4">
|
118
|
+
|
119
|
+
<h4>b</h4>
|
120
|
+
|
121
|
+
<p><select class="form-control input-sm" id="wme" name="wme"></select></p>
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="col-md-2 col-sm-2">
|
126
|
+
|
127
|
+
<h4>c</h4>
|
128
|
+
|
129
|
+
<p><input type="checkbox" id="wking" name="wking" style="width:20px; height:20px;"></p>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div class="col-md-2 col-sm-3" style="margin-left:20px;">
|
134
|
+
|
135
|
+
<h4>d</h4>
|
136
|
+
|
137
|
+
<p><input type="text" data-td="" id="acttime" class="pdtime cs-time input-sm cs-center timepicker">H</p>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="col-md-2 col-sm-3" style="margin-left:20px;">
|
142
|
+
|
143
|
+
<h4>f</h4>
|
144
|
+
|
145
|
+
<p><input type="text" data-td="" id="nontime" class="pdtime cs-time input-sm cs-center timepicker">H</p>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<table id="ipt" class="table table-bordered"></table>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<div>
|
158
|
+
|
159
|
+
<button type="button" class="addb btn btn-info btn-sm" id="bt-addt">追加</button>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
</script>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<script type="text/template" id="used-lm">
|
168
|
+
|
169
|
+
<table class="table table-bordered" id="mc" style="width: 65%">
|
170
|
+
|
171
|
+
<thead id="th">
|
172
|
+
|
173
|
+
<th class="mstb1 cs-center">z</th>
|
174
|
+
|
175
|
+
<th class="mstb2 cs-center">x</th>
|
176
|
+
|
177
|
+
<th class="mstb3 cs-center">c</th>
|
178
|
+
|
179
|
+
<th class="mstb4 cs-center">v</th>
|
180
|
+
|
181
|
+
<th class="mstb5 cs-center">b</th>
|
182
|
+
|
183
|
+
<th class="mstb6 cs-center">n</th>
|
184
|
+
|
185
|
+
</thead>
|
186
|
+
|
187
|
+
<tbody id="testm"></tbody>
|
188
|
+
|
189
|
+
</table>
|
190
|
+
|
191
|
+
</script>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<script type="text/template" id="addmtltbl">
|
196
|
+
|
197
|
+
<tr class="cs-lista" style="height: 20px">
|
198
|
+
|
199
|
+
<td class="tbl1" data-m1="<%- val1 %>" id="aval1"><%- val1 %></td>
|
200
|
+
|
201
|
+
<td class="tbl2" data-m2="<%- val2 %>" id="aval2"><%- val2 %></td>
|
202
|
+
|
203
|
+
<td class="tbl3" data-m3="<%- val3 %>" id="aval3"><%- val3 %></td>
|
204
|
+
|
205
|
+
<td class="tbl4" data-m4="<%- val4 %>" id="aval4"><%- val4 %></td>
|
206
|
+
|
207
|
+
<td class="tbl5" data-m5="<%- val5 %>" id="aval5"><%- val5 %></td>
|
208
|
+
|
209
|
+
<td class="tbl6" data-m6="<%- val6 %>" id="aval6"><%- val6 %></td>
|
210
|
+
|
211
|
+
</tr>
|
212
|
+
|
213
|
+
</script>
|
214
|
+
|
215
|
+
```
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
削除したいテーブルは
|
220
|
+
|
221
|
+
```html
|
222
|
+
|
223
|
+
<script type="text/template" id="ust-list1">
|
224
|
+
|
225
|
+
<thead id="th-list1">
|
226
|
+
|
227
|
+
<tr>
|
228
|
+
|
229
|
+
<th class="list1-col1 cs-center">a</th>
|
230
|
+
|
231
|
+
<th class="list1-col2 cs-center">b</th>
|
232
|
+
|
233
|
+
<th class="list1-col3 cs-center">c</th>
|
234
|
+
|
235
|
+
<th class="list1-col4 cs-center">d</th>
|
236
|
+
|
237
|
+
<th class="list1-col5 cs-center">e</th>
|
238
|
+
|
239
|
+
<th class="list1-col6 cs-center">f</th>
|
240
|
+
|
241
|
+
</tr>
|
242
|
+
|
243
|
+
</thead>
|
244
|
+
|
245
|
+
<tbody id="showltbl1"></tbody>
|
246
|
+
|
247
|
+
</script>
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
<script type="text/template" id="addbtbl">
|
252
|
+
|
253
|
+
<tr class="cs-showb cs-pointer" style="height: 35.56px" data-row="">
|
254
|
+
|
255
|
+
<td class="list1-col1" data-b1="<%- val1 %>" id="bld1"><%- val1 %></td>
|
256
|
+
|
257
|
+
<td class="list1-col2" data-b2="<%- val2 %>" id="bld2"><%- val2 %></td>
|
258
|
+
|
259
|
+
<td class="list1-col3" data-b3="<%- val3 %>" id="bld3"><%- val3 %></td>
|
260
|
+
|
261
|
+
<td class="list1-col4" data-b4="<%- val4 %>" id="bld4"><%- val4 %></td>
|
262
|
+
|
263
|
+
<td class="list1-col5" data-b5="<%- val5 %>" id="bld5"><%- val5 %></td>
|
264
|
+
|
265
|
+
<td class="list1-col6 cs-center" data-b6="<%- val6 %>" id="bld6"><%- val6 %></td>
|
266
|
+
|
267
|
+
</tr>
|
268
|
+
|
269
|
+
</script>
|
270
|
+
|
271
|
+
```
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
```js
|
278
|
+
|
279
|
+
if(($("#showltbl1 .cs-selected").children(".list1-col1").attr('data-b1') != "") ||
|
280
|
+
|
281
|
+
($("#showltbl1 .cs-selected").children(".list1-col2").attr('data-b2') != "") ||
|
282
|
+
|
283
|
+
($("#showltbl1 .cs-selected").children(".list1-col3").attr('data-b3') != "") ||
|
284
|
+
|
285
|
+
($("#showltbl1 .cs-selected").children(".list1-col4").attr('data-b4') != "") ||
|
286
|
+
|
287
|
+
($("#showltbl1 .cs-selected").children(".list1-col5").attr('data-b5') != "") ||
|
288
|
+
|
289
|
+
($("#showltbl1 .cs-selected").children(".list1-col6").attr('data-b6') != "")){
|
290
|
+
|
291
|
+
if($('#showltbl1:has(tr.cs-selected)').length>0){
|
292
|
+
|
293
|
+
$('#showltbl1 tr.cs-selected').nextUntil(':not(:has(td[data-b1=""])),
|
294
|
+
|
295
|
+
:not(:has(td[data-b2=""])),
|
296
|
+
|
297
|
+
:not(:has(td[data-b3=""])),
|
298
|
+
|
299
|
+
:not(:has(td[data-b4=""])),
|
300
|
+
|
301
|
+
:not(:has(td[data-b5=""])),
|
302
|
+
|
303
|
+
:not(:has(td[data-b6=""]))').addClass('collect');
|
304
|
+
|
305
|
+
$('#showltbl1 .cs-selected,#showltbl1 .collect').remove();
|
306
|
+
|
307
|
+
};
|
308
|
+
|
309
|
+
}
|
310
|
+
|
311
|
+
```
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
上のjqueryのようにある条件下のテーブルをすべて消したときに
|
316
|
+
|
317
|
+
そのデータが該当するオブジェクト配列の部分を消したいのですがやり方が分かりません。
|
318
|
+
|
319
|
+
↓のはオブジェクト配列です。 オブジェクトの格納方法は.pushで行っています。
|
14
320
|
|
15
321
|
```jquery
|
16
322
|
|
17
|
-
i
|
323
|
+
objList1 = {"a":[],"b":[],,"c":[],"d":[],"d":[],"e":[],"f":[],"g":[],"h":[]};
|
18
|
-
|
19
|
-
($("#showltbl1 .cs-selected").children(".list1-col2").attr('data-b2') != "") ||
|
20
|
-
|
21
|
-
($("#showltbl1 .cs-selected").children(".list1-col3").attr('data-b3') != "") ||
|
22
|
-
|
23
|
-
($("#showltbl1 .cs-selected").children(".list1-col4").attr('data-b4') != "") ||
|
24
|
-
|
25
|
-
($("#showltbl1 .cs-selected").children(".list1-col5").attr('data-b5') != "") ||
|
26
|
-
|
27
|
-
($("#showltbl1 .cs-selected").children(".list1-col6").attr('data-b6') != "")){
|
28
|
-
|
29
|
-
if($('#showltbl1:has(tr.cs-selected)').length>0){
|
30
|
-
|
31
|
-
$('#showltbl1 tr.cs-selected').nextUntil(':not(:has(td[data-b1=""])),
|
32
|
-
|
33
|
-
:not(:has(td[data-b2=""])),
|
34
|
-
|
35
|
-
:not(:has(td[data-b3=""])),
|
36
|
-
|
37
|
-
:not(:has(td[data-b4=""])),
|
38
|
-
|
39
|
-
:not(:has(td[data-b5=""])),
|
40
|
-
|
41
|
-
:not(:has(td[data-b6=""]))').addClass('collect');
|
42
|
-
|
43
|
-
$('#showltbl1 .cs-selected,#showltbl1 .collect').remove();
|
44
|
-
|
45
|
-
};
|
46
|
-
|
47
|
-
}
|
48
324
|
|
49
325
|
```
|
50
326
|
|
51
327
|
|
52
328
|
|
53
|
-
上のjqueryのようにある条件下のテーブルをすべて消したときに
|
54
|
-
|
55
|
-
そのデータが該当するオブジェクト配列の部分を消したいのですがやり方が分かりません。
|
56
|
-
|
57
|
-
↓のはオブジェクト配列です。 オブジェクトの格納方法は.pushで行っています。
|
58
|
-
|
59
|
-
```jquery
|
60
|
-
|
61
|
-
objList1 = {"a":[],"b":[],,"c":[],"d":[],"d":[],"e":[],"f":[],"g":[],"h":[]};
|
62
|
-
|
63
|
-
```
|
64
|
-
|
65
|
-
|
66
|
-
|
67
329
|
無知で申し訳ありませんがどうか、力をお貸しください。
|
1
内容の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
いつもお世話になっております。
|
2
|
+
|
3
|
+
オブジェクト配列に入れるデータmodalから入力された値を格納しています。
|
2
4
|
|
3
5
|
あるテーブルを複数行、消したときにオブジェクト配列に格納してあるデータで該当するところを
|
4
6
|
|