1.首先得下载EasyUi包。
2.前端html代码如下:
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
ViewBag.Title = "拍卖会列表";
Layout = null;
}
@using Microsoft.AspNetCore.Html
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>518大学生创业拍卖会</title>
<script src="~/js/jquery-2.2.0.min.js"></script>
<script src="~/js/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
<link href="~/js/jquery-easyui-1.5.1/themes/color.css" rel="stylesheet" />
<link href="~/js/jquery-easyui-1.5.1/demo/demo.css" rel="stylesheet" />
<link href="~/js/jquery-easyui-1.5.1/themes/icon.css" rel="stylesheet" />
<link href="~/js/jquery-easyui-1.5.1/themes/metro/easyui.css" rel="stylesheet" />
<style type="text/css">
#fm {
margin: 0;
padding: 10px 30px;
}
.ftitle {
font-size: 14px;
font-weight: bold;
color: #666;
padding: 5px 0;
margin-bottom: 10px;
border-bottom: 1px solid #ccc;
}
.fitem {
margin-bottom: 5px;
}
.fitem label {
display: inline-block;
width: 80px;
}
</style>
<script type="text/JavaScript">
$(document).ready(function () {
$('#tt').datagrid({
//
width: '100%',
height: '500px',
url: "/test0703/Load", //接收从控制器传回来的load方法的数据
columns: [[
{ field: 'Id', title: '编号' },
{ field: 'MeetName', title: '拍卖会名称', width: 200 },
{ field: 'Creater', title: '发布人', width: 200 },
{ field: 'Desc', title: '简介', width: 200 }
//{ field: 'Remark', title: '备注', width: 200 }
]],
toolbar: [{
text: "添加",
iconCls: "icon-add",
handler: function () {
newStudent();
}
}, "-", {
text: "修改",
iconCls: "icon-edit",
handler: function () {
// edit();
editUser();
}
}, "-", {
text: '删除',
iconCls: 'icon-remove',
handler: function () {
destroyUser();
}
}
],
singleSelect: true,
pagination: true
// rownumbers: true
});
});
// -- -- -- -- -- -- -- --