87,901
社区成员
发帖
与我相关
我的任务
分享
<table id="Class_Table" class="table table-hover"></table>
<script>
$('#Class_Table').bootstrapTable({
url: "GetClass.jsp",
method : 'post', // 请求方式(*)post/get
contentType: "application/x-www-form-urlencoded",
queryParams: "queryParams",
toolbar: "#toolbar",
sidePagination: "true",
striped: true, // 是否显示行间隔色
search : "true",
uniqueId: "ID",
pageSize: "5",
pagination: true, // 是否分页
sortable: true, // 是否启用排序
responseHandler:function (res) {
return res.DATA;
},
columns: [{
field: 'cno',
title: '课程号'
},
{
field: 'cname',
title: '课程名'
},
{
field: 'credit',
title: '学分'
},
{
title: '操作',
width: 120,
align: 'center',
valign: 'middle',
formatter: actionFormatter,
}
]
});
//操作栏的格式化
function actionFormatter(value, row, index) {
var id = value;
var result = "";
result += "<a href='javascript:;' class='btn btn-xs green' onclick=\"EditViewById('" + id + "', view='view')\" title='查看'><span class='glyphicon glyphicon-search'></span></a>";
result += "<a href='javascript:;' class='btn btn-xs blue' onclick=\"EditViewById('" + id + "')\" title='编辑'><span class='glyphicon glyphicon-pencil'></span></a>";
result += "<a href='javascript:;' class='btn btn-xs red' onclick=\"DeleteByIds('" + id + "')\" title='删除'><span class='glyphicon glyphicon-remove'></span></a>";
return result;
}
</script>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="org.json.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<jsp:useBean id="ClassMessage" class="javabean.ClassMessage" scope="page"/>
<%
JSONArray json = new JSONArray();
json= ClassMessage.getForm();
out.print(json);
%>
</body>
</html>