87,992
社区成员
发帖
与我相关
我的任务
分享

$(function(){
$('#dg').datagrid({
title:"学员信息",
url:'system/studentinfo/data_getalllist',
toolbar:'#toolbar',
rownumbers:true, //true 显示行号
pagination:true, //true 允许分页
collapsible:true, //true 可折叠
//singleSelect:true, //true 只允许单选
striped:true, //true 就把行条纹化(即奇偶行使用不同背景色)
fitColumns:true, //true 就会自动扩大或缩小列的尺寸以适应表格的宽度并且防止水平滚动
fit:true, //true 自动补全
nowrap:false, //false 允许数据换行
loadMsg:"正在加载数据,请稍等", //加载数据时,显示的提示信息
frozenColumns:[[
{field:'student_ID',title:'编号',width:50,align:'center',checkbox:true},
{field:'student_NUM',title:'学号',width:80,align:'center',sortable:true},
{field:'student_NAME',title:'姓名',width:80,align:'center'}
]],
columns:[[
{field:'student_SEX',title:'性别',width:50,align:'center',rowspan:2},
{field:'rank_NAME',title:'级别',width:80,align:'center',rowspan:2},
{field:'student_IS_PAYTUITION',title:'是否已交学费',width:80,align:'center',rowspan:2,
formatter:function(value, record){
if (value == "N") {
value = "未交费";
return '<span style="color:red;">' + value + '</span>';
} else {
value = "已交费";
return value;
}
}
},
{field:'tuition_info',title:'学费信息',align:'center',colspan:3},
{field:'student_STARTTIME',title:'注册时间',width:80,align:'center',rowspan:2},
{field:'student_IS_ONSTUDY',title:'是否在学',width:80,align:'center',rowspan:2,
formatter:function(value, record){
if (value == "Y") {
value = "是";
return value;
} else {
value = "否";
return '<span style="color:red;">' + value + '</span>';
}
}
},
{field:'student_PHONE',title:'联系电话',width:100,align:'center',rowspan:2},
{field:'showdetail',title:'详细',width:100,align:'center',rowspan:2,
formatter:function(value, row, index){
var btn1 = '<a class="detailcls" href="javascript:void(0)" onclick="showdetail('+index+')" ></a>';
return btn1;
}
},
{field:'opr',title:'操作',width:100,align:'center',rowspan:2,
formatter:function(value, row, index){
var btn2 = '<a class="editcls" href="javascript:void(0)" onclick="editStudent('+index+')" ></a>';
return btn2;
}
}],
[{field:'tuition_TYPE',title:'学费类别',width:80,align:'center'},
{field:'student_TUITION_STARTTIME',title:'交费时间',width:80,align:'center'},
{field:'student_TUITION_ENDTIME',title:'到期时间',width:80,align:'center'}
]],
onLoadSuccess:function(data){
$('.detailcls').linkbutton({text:'详细信息',plain:true,iconCls:'icon-edit'});
$('.editcls').linkbutton({text:'编辑',plain:true,iconCls:'icon-edit'});
}
})
});