// 初始化数据列表
function initDatagrid() {
$('#dg').datagrid({
loadMsg: '数据加载中请稍后……',
striped: true,
url: '/api/Attendance',
sortName: 'ID',
sortOrder: 'desc',
method: "get",
striped: true,
border: true,
selectOnCheck: false,
checkOnSelect: false,
remoteSort: true,
singleSelect: true,
idField: 'ID',
pagination: true,
rownumbers: false,
pageSize: 100, // 每页显示的记录条数,默认为100
pageList: [20, 50, 100, 200, 500], // 设置可选的每页记录条数的列表
fitColumns: true,
columns: [[
{
field: 'Num', title: "编号", width: 34, sortable: false
},
{
field: 'Employee', title: "人员", width: 64, sortable: true
},
{
field: 'Extra', title: "加班
(天)", width: 50, sortable: true,
// 只有添加了editor的列才是可编辑的
editor: {
type: 'numberbox',
options: {
precision: 3,
onChange: function () {
var rowIndex = getRowIndex(this);
up