<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="../../path.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>成绩管理</title>
<link type="text/css" rel="stylesheet" href="common/css/easyui/themes/default/easyui.css" />
<link type="text/css" rel="stylesheet" href="common/css/easyui/themes/icon.css" />
<script src="common/js/jquery/jquery.min.2.0.js"></script>
<script src="common/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="common/js/date/WdatePicker.js"></script>
<script type="text/javascript">
function a(csid){
alert(csid);
}
$(function () {
var array=new Array();
$.post("menu/queryButton",{"mid":'<%=request.getParameter("mid") %>'},function(data){
for(var i=0;i<data.length;i++){
array[i]=data[i];
$("#toolbar").append("<a id="+data[i].action+">"+data[i].name+"</a>");
}
},'json');
//由于easyui的执行原理是 先创建html标签在进行渲染
window.setTimeout(function(){
for(var i=0;i<array.length;i++){
$("#"+array[i].action).linkbutton({
iconCls: array[i].icon,
plain:true
});
}
//查询按钮
$("#btnSearch").click(function(){
$.post("<%=basePath%>/stuStore/search?mark="+0, $("#formInfo").serialize(),function(data){
$('#dg').datagrid("reload",data);
},"json");
});
//新增按钮
$("#btnAdd").click(function(){
location.href = '<%=basePath%>/teaching/StudentAchievementManagement/add.jsp';
});
//修改按钮
$("#btnEdit").click(function(){
location.href = '<%=basePath%>/teaching/StudentAchievementManagement/edit.jsp';
});
//导入按钮
$("#btnDr").click(function(){
$.messager.alert('提示','导入','info');
});
//导出按钮
$("#btnDc").click(function(){
$.messager.alert('提示','导出','info');
});
//删除按钮
$("#btnDelete").click(function(){
var rows =$("#dg").datagrid("getSelections");
if(rows.length==0){
$.messager.alert('警告','请选择要删除的信息!');
return;
}
$.messager.confirm('确认','您确认想要删除记录吗?',function(r){
if(r){
var sid="";
for(var i = 0; i <rows.length;i++){
if(sid == ""){
sid = rows[i].sid;
}else{
sid += ","+rows[i].sid;
}
}
//post提交
$.post("<%=basePath%>/stuStore/deleteScore",{"sid":sid},function(data){
$("#dg").datagrid("reload");
});
}
});
});
},900);
//自动加载表格
$('#dg').datagrid({
url:'<%=basePath%>/stuStore/search?mark='+0,
pageSize: 15,//每页显示的记录条数,默认为10
pageList: [15,30,45],//可以设置每页记录条数的列表
pagination : true, //显示底部工具栏
striped:true,
fit:true,
rownumbers:true,//行号
singleSelect:true,
loadMsg : '数据装载中......',
onLoadSuccess : function (data) {
if (data.rows<1) {
var body = $(this).data().datagrid.dc.body2;
body.find('table tbody').append('<tr><td width="' + body.width() + '" style="height: 35px; text-align: center;">当前页没有数据</td></tr>');
}
},
frozenColumns: [[
{field:'idcard',title:'身份证号',align:'center',width:160},
{field:'studentname',title:'学生姓名',align:'center',width:100},
{field:'cname',title:'年级',width:80,align:'center'}
]],
hideColumn:[{field:'sid',title:'sid'},
{field:'stuid',title:'学生编号'}],
columns:[[
{field:'studentClass',title:'班级',width:80,align:'center'},