index.html
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<include file="public@header" />
</head>
<body>
<table class="table table-bordered" style="margin:10px 10px;">
<caption>地图管理</caption>
<thead>
<tr>
<th>公司名称</th>
<th>经度</th>
<th>纬度</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>{$data.name}</td>
<td>{$data.jingdu}</td>
<td>{$data.weidu}</td>
<td><button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">编辑</button></td>
</tr>
</tbody>
</table>
<!-- 编辑模态框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">地图编辑</h4>
</div>
<div class="modal-body">
<div style="padding: 30px 100px 10px;">
<div class="input-group">
<span class="input-group-addon">公司名称:</span>
<input type="text" class="form-control" name="name" value="{$data.name}">
</div>
<br>
<div class="input-group">
<span class="input-group-addon">经度:</span>
<input type="text" class="form-control" name="jingdu" value="{$data.jingdu}">
</div>
<br>
<div class="input-group">
<span class="input-group-addon">纬度:</span>
<input type="text" class="form-control" name="weidu" value="{$data.weidu}">
</div>
<br>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="bianji()">提交更改</button>
</div>
</div>
</div>
</div>
<script>
//当点击更改时
function bianji(){
name = $("input[name='name']").val();
jingdu = $("input[name='jingdu']").val();
weidu = $("input[name='weidu']").val();
console.log(name,jingdu,weidu);
}
</script>
</body>
</html>