引用:
@*1、Jquery组件引用*@ @*2、bootstrap组件引用*@ @*3、bootstrap table组件以及中文包的引用*@
@*4、页面Js文件的引用*@
<script src="~/Scripts/Home/Index.js"></script>界面:
<table class="table table-striped" id="Table"></table>
Index.js:
$(function () { var columns = [{ field: "choose", checkbox: true, align: "center" }, { field: 'id', title: '序号', formatter: function (value, row, index) { return index + 1; } },{ field: 'CreateTime', title: '创建时间' }, { field: 'CreateMan', title: '创建人' }, { field: 'UpdateTime', title: '更新时间', }, { field: 'UpdateMan', title: '更新人' }, { field: 'operation', title: '操作', formatter: function (value, row, index) { var s = '编辑'; var d = '删除'; var t = '查看详情'; return s + ' ' + d + ' ' + t; }, events: 'operateEvents' }]; //初始化Table var oTable = new TableInit('#Table', '控制器', columns, 'Id'); oTable.Init(); });});
//operateEvents事件window.operateEvents = { 'click .edit': function (e, value, row, index) { //执行内容 }, 'click .remove': function (e, value, row, index) { //执行内容 }, 'click .allocationrole': function (e, value, row, index) { //执行内容 }}
function DataBaseFunctionSearch(FormId) { var FData = $("#" + FormId).serializeArray(); var data = []; for (var i = 0; i < FData.length; i++) { if (FData[i].value != "") { data.push(FData[i]); } } var result = ""; for (var i = 0; i < data.length; i++) { result += data[i].name + ":" + data[i].value + "█"; } return result.substring(0, result.length - 1);}