1.在html中写一个按钮:
<a href="javascript:;" class="btn btn-all-pass btn-success btn-disabled disabled " title="{:__('All_pass')}" >{:__('All_pass')}</a>
2.在js头部定义一个template:
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template)
3.在js中写一个事件:
index: function () {
var table = $("#table");
// 为表格绑定事件
Table.api.bindevent(table);
//标记为全部通过
$(document).on('click','.btn-all-pass',function () {
var ids = Table.api.selectedids(table);
Layer.open({
title: __('Warning'),
content: Template("tpl-all-pass", {}),
btn: [__('OK'),__('Cancel')],
yes: function (index,layero) {
Fast.api.ajax({
url: "ykvr/video/video/check/ids/" + ids.join(","),
type: "post",
data: {state: 1},
}, function () {
table.bootstrapTable('refresh', {});
Layer.close(index);
});
},success: function (layero, index) {
}
});
});
4.在html中写入弹窗的内容:
<script id="tpl-all-pass" type="text/html">
<div class="form-group">
{:__('Video_all_pass')}
</div>
</script>