<link href=
"../../Content/easyUI/themes/default/easyui.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link href=
"../../Content/easyUI/themes/icon.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script src=
"../../Scripts/jquery-...min.js"
type=
"text/javascript"
></script>
<script src=
"../../Scripts/jquery.easyui.min.js"
type=
"text/javascript"
></script>
<script src=
"../../Scripts/easyui-lang-zh_CN.js"
type=
"text/javascript"
></script>
<script src=
"../../Scripts/datapattern.js"
type=
"text/javascript"
></script>
:<script type=
"text/javascript"
>
$(
function
(){
loadData();
});
function
loadData() {
$(
'#tt'
).datagrid({
url:
'/Home/GetUserInfo'
,
title:
'用户数据表格'
,
width: ,
height: ,
fitColumns:
true
,
nowrap:
false
,
idField:
'ID'
,
loadMsg:
'正在加载用户的信息...'
,
pagination:
true
,
singleSelect:
false
,
pageSize:,
pageNumber: ,
pageList: [, , ],
queryParams: {},
columns: [[
{ field:
'ck'
, checkbox:
true
, align:
'left'
, width: },
{ field:
'ID'
, title:
'编号'
, width: },
{ field:
'UserName'
, title:
'姓名'
, width: },
{ field:
'UserPass'
, title:
'密码'
, width: },
{ field:
'Email'
, title:
'邮箱'
, width: },
{ field:
'RegTime'
, title:
'时间'
, width: , align:
'right'
,
formatter:
function
(value, row, index) {
return
(eval(value.replace(/\/Date\((\d+)\)\
}
}
]],
toolbar: [{
id:
'btnGet'
,
text:
'删除'
,
iconCls:
'icon-add'
,
handler:
function
() {
var
rows = $(
'#tt'
).datagrid(
'getSelections'
);
if
(!rows || rows.length == ) {
$.messager.alert(
"提醒"
,
"请选择要删除的记录!"
,
"error"
);
return
;
}
}
}],
});
}
</script>
<div>
<table id=
"tt"
style=
"width: px;"
title=
"标题,可以使用代码进行初始化,也可以使用这种属性的方式"
iconcls=
"icon-edit"
>
</table>
</div>
function
ChangeDateFormat(cellval) {
var
date =
new
Date(parseInt(cellval.replace(
"/Date("
,
""
).replace(
")/"
,
""
), ));
var
month = date.getMonth() + < &
#63; "" + (date.getMonth() + ) : date.getMonth() + ;
var
currentDate = date.getDate() < &
#63; "" + date.getDate() : date.getDate();
return
date.getFullYear() +
"-"
+ month +
"-"
+ currentDate;
}