1 回答

TA貢獻1864條經(jīng)驗 獲得超2個贊
指定從DB導入的數(shù)據(jù)變量同名,通過狀態(tài)值注冊條件語句,獲取符合條件的DB數(shù)據(jù)。并繪制一個JQgrid來擬合數(shù)據(jù)。
MyBatis.xml
select id="list" parameterType="hashmap" resultType="hashmap">
<choose>
<when test='approval_status == "0"'>
SELECT
seq_no AS col1,
nick_name AS col2,
...
FROM DB_DB
<when test='approval_status == "1"'>
SELECT
seq_no AS col1,
............
</choose>
jqgrid.js
function setRequestList(jqgrid_data,status){
var title = [];
if(status == '0'){
title = ['No', 'nick',... ];
}else if(status == '1'){
title = ['No', 'name', ... ];
}
var colmodel = [];
$("#requestList").jqGrid("GridUnload");
jQuery("#requestList").jqGrid({
data : jqgrid_data,
datatype : "local",
height : 'auto',
colNames : title,
colModel : [{
name : 'col1',
index : 'seq',
align : 'center',
sortable : false
}
...
添加回答
舉報