質問編集履歴

2

ソース修正

2018/05/08 09:14

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -64,11 +64,9 @@
64
64
 
65
65
  <td>
66
66
 
67
- <input type='hidden' name='code' value='{{$result->code}}'>
68
-
69
- <input type="button" value="編集" class="btn btn-primary btn-xs editmodal">
67
+ <input type="button" value="編集" class="btn btn-primary btn-xs editmodal" data-code="{{$result->code}}" data-code2="{{$result->code2}}">
70
-
68
+
71
- <div class="modal fade" id="sampleModal">
69
+ <div class="modal fade" id="sampleModal_{{$result->code}}">
72
70
 
73
71
  <div class="modal-dialog" style="display: block;">
74
72
 
@@ -144,9 +142,11 @@
144
142
 
145
143
 
146
144
 
147
- var code = $(':hidden[name="code"]').val();
145
+ var code = $(this).data('code');
148
-
146
+
149
- console.log(code);
147
+ var code2 = $(this).data('code2');
148
+
149
+
150
150
 
151
151
  ajax = $.ajax(
152
152
 
@@ -162,7 +162,9 @@
162
162
 
163
163
  {
164
164
 
165
- "code":code
165
+ "code":code,
166
+
167
+ "code2":code2
166
168
 
167
169
  },
168
170
 
@@ -170,6 +172,8 @@
170
172
 
171
173
  {
172
174
 
175
+ console.log(json);
176
+
173
177
  $('#sample_point td').remove();
174
178
 
175
179
  for(var i=0;i<json.length;i++){
@@ -224,7 +228,7 @@
224
228
 
225
229
  });
226
230
 
227
- $('#sampleModal').modal();
231
+ $('#sampleModal_'+code).modal();
228
232
 
229
233
 
230
234
 

1

タグ追加

2018/05/08 09:14

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
File without changes