关于easyUI 调用function方法传参问题,传的是整形的就有用换成string的就没用了,在线求解,各位只需关注红字部分即可
<%@ 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);
//自动加载表格<