investigate_sales_delete_model.ftl
6.61 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<div id="investigateSalesDeleteForm" class="modal" tabindex="-1">
<div class="modal-dialog">
<input type="hidden" id="mode_investigateId" name="mode_investigateId" />
<div class="main-container ace-save-state" id="main-container">
<!-- /section:basics/sidebar -->
<div class="main-content">
<div class="main-content-inner">
<!-- /section:basics/content.breadcrumbs -->
<div class="modal-body">
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<!-- /section:basics/content.search -->
<div class="row">
<div class="col-sm-8"></div>
</div>
<!-- /section:basics/content.search -->
<!-- PAGE CONTENT BEGINS -->
<table id="investigate-sales-delete-table" class="table table-bordered table-hover">
<thead>
<tr>
<th class="center">选择</th>
<th class="center">姓名</th>
<th class="center">联系号码</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot></tfoot>
</table>
<!-- PAGE CONTENT ENDS -->
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.page-content -->
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">取消</a>
<a href="javascript:void(0);" class="btn btn-primary" data-dismiss="modal" id="investigate_sales_delete_submit">确定删除</a>
</div>
</div>
</div><!-- /.main-content -->
</div><!-- /.main-container -->
</div>
</div>
<script src="/js/jquery.js"></script>
<script type="text/javascript">
var investigateId = $('#mode_investigateId').val();
$(document).ready(function(){
var extensions = {
"sFilter": "simple-table_filter hide",
"sLength": "simple-table_length custom_length_class"
};
// Used when bJQueryUI is false
$.extend($.fn.dataTableExt.oStdClasses, extensions);
// Used when bJQueryUI is true
//$.extend($.fn.dataTableExt.oJUIClasses, extensions);
var investigate_sales_delete_table = $('#investigate-sales-delete-table').DataTable({
ajax: {
url: "/investigate/salesList",
type:"GET",
//dataSrc : "list",//这个参数是自己封装的json里面的key
data: {
investigateId: investigateId
}
},
serverSide : true,//开启服务器模式:启用服务器分页
pageLength: 5,//每页显示三条数据
bPaginate: false, //翻页功能
bLengthChange: false, //改变每页显示数据数量
bFilter: false, //过滤功能
bSort: false, //排序功能
Info: true,//页脚信息
bAutoWidth: false,//自动宽度
bJQueryUI: false,
bStateSave : false,
aLengthMenu: [[10, 25, 50, 10], [10, 25, 100, -1]],
sDom: "<'row-fluid inboxHeader'<'span6'<'dt_actions'>l><'span6'f>r>t<'row-fluid inboxFooter'<'span6'i><'span6'p>>",
oLanguage: {//下面是一些汉语翻译
"sSearch": "搜索",
"sLengthMenu": "每页显示 _MENU_ 条记录",
"sZeroRecords": "没有检索到数据",
"sInfo": "显示 _START_ 至 _END_ 条 共 _TOTAL_ 条",
"sInfoFiltered": "(筛选自 _MAX_ 条数据)",
"sInfoEmtpy": "没有数据",
"sProcessing": "正在加载数据...",
//"sProcessing": "<img src='{{rootUrl}}global/img/ajaxLoader/loader01.gif' />", //这里是给服务器发请求后到等待时间显示的 加载gif
"oPaginate":
{
"sFirst": "首页",
"sPrevious": "前一页",
"sNext": "后一页",
"sLast": "末页"
}
},
columns: [ //这个属性下的设置会应用到所有列,按顺序没有是空
{
"data": 'mobile',
render : function(data, type, row, meta) {
return '<input type="checkbox" name="mobile" id="' + data+ '"/>';
}
},
{
"data": 'name',
"sDefaultContent" : "",
"sClass" : "center"
},
{
"data": 'mobile',
"sDefaultContent" : "",
"sClass" : "center"
}
],
bProcessing: true, //开启读取服务器数据时显示正在加载中……特别是大数据量的时候,开启此功能比较好
sPaginationType: "full_numbers"
});
$('#investigate_sales_delete_submit').bind('click',function(){
var mobiles = '';
$("input[name='mobile']:checked").each(function(i){
mobiles = mobiles + $(this).attr('id') + ',';
});
if (mobiles != '') {
$.ajax({
url: "/investigate/removeSales",
data:{investigateId: investigateId,mobiles:mobiles},
type: "POST",
dataType:'json',
async : false,
traditional: true,//这里设置为true
success:function(data){
alert(data.msg);
location.reload(true);
},
error:function(er){
alert("删除失败");
}
});
}else{
alert("请选择需要删除的人员");
}
});
});
</script>