My page source code
<% @ page language="Java" contentType="text/HTML. Charset=utf-8 "pageEncoding=" utf-8 "% & gt;
<meta charset="utf-8" & gt;The test list & lt;/title>
<link rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics/easyui/themes/default/easyui.css" & gt;
<link rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics/easyui/themes/icon.css" & gt;
<link rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics/easyui/css/demo.css" & gt;
<body &western nl &western AD="setLabel ()" & gt;$(function () {
Var examids=document. GetElementById (" examids "). The value;
Var examanalyids=document. GetElementById (" examanalyids "). The value;
Var gradeid=document. GetElementById (" gradeid "). The value;
The console. The log (" to obtain the values of the parameters "+ examids);
Ids={" examids [] ": examids, examanalyids" [] ": examanalyids," gradeid ", gradeid};
$. Ajax ({
Type: "post",
Url: "ExamanalyServlet? Method=ColumnList ",
Data: ids,
DataType: "json",
Async: false,
Success: the function (result) {
The console. The log (" result1: "+ result);
Var columnsAvg=[];
$. Each (result, function (I, course) {
Var column={};
The column (" field ")="is actually" + course. Id.
The column (" title ")=course. Name;
The column (" width ")=70;
The column [" the resizable "]=false;
The column [" sortable "]=true;
ColumnsAvg. Push (column);
});
The console. The log (columnsAvg);
$(" # analysisResultAvg "). The datagrid ({
The columns: [
ColumnsAvg
]
});
}
});
$. Ajax ({
Type: "post",
Url: "ClazzServlet? Method=ClazzList& T="+ new Date (). GetTime (),
Data: {" gradeid ", gradeid},
DataType: "json",
Async: false,
Success: the function (result) {
The console. The log (" result2: "+ result);
Var columnsRank=[];
$. Each (result, function (I, clazz) {
Var column={};
The column (" field ")="clazz" + clazz. Id.
The column (" title ")=clazz. Name;
The column (" width ")=70;
The column [" the resizable "]=false;
The column [" sortable "]=true;
ColumnsRank. Push (column);
});
The console. The log (columnsRank);
$(" # analysisResultRank "). The datagrid ({
The columns: [
ColumnsRank
]
});
}
});
SetTimeout (function () {
$(" # analysisResultAvg "). The datagrid (" options "). The url="ExamanalyServlet? Method=CheckAnaly& T="+ new Date (). GetTime ();
$(" # analysisResultAvg "). The datagrid (" options "). The queryParams=ids;
$(" # analysisResultRank "). The datagrid (" options "). The url="ExamanalyServlet? Method=RankAnaly& T="+ new Date (). GetTime ();
$(" # analysisResultRank "). The datagrid (" options "). The queryParams=ids;
$(" # analysisResultAvg "). The datagrid (" reload ");
$(" # analysisResultRank "). The datagrid (" reload ");
}, 100);
//performance analysis result list
$(" # analysisResultAvg "). The datagrid ({
Border: true,
Collapsible: false,//if the folding
//fit: true,//automatic size has this property, the second form is showed not to come out
Method: "post",
Noheader: true,
SingleSelect: true,//radio
SortOrder: 'DESC',
RemoteSort: false,
FrozenColumns: [[
{field: 'clazzid', the title: '10 each shift, width: 120, the resizable: false, sortable: false},
]],
});
$(" # analysisResultRank "). The datagrid ({
Border: true,
Collapsible: false,//if the folding
Fit: true,//automatic size
Method: "post",
Noheader: true,
SingleSelect: true,//radio
SortOrder: 'DESC',
RemoteSort: false,
FrozenColumns: [[
{field: 'rankNo', the title: 'ranking section, width: 120, the resizable: false, sortable: false},
]],
});
});
</script>
<style>
. Panelcontent {padding: 10 px 5 px 15 px 20 px; }
</style>
- Related
- Links:
- CodePudding