You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>table模块快速使用</title>
|
|
<link rel="stylesheet" href="/lib/layui/css/layui.css" media="all">
|
|
<script src="/lib/layui/layui.js" charset="utf-8"></script>
|
|
<script type="text/javascript" src="/js/xadmin.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<table id="demo" lay-filter="test"></table>
|
|
|
|
<script>
|
|
layui.use(['table', 'jquery'], function () {
|
|
var table = layui.table;
|
|
var $ = layui.jquery;
|
|
//第一个实例
|
|
table.render({
|
|
elem: '#test'
|
|
|
|
// ,url: '/json/users.json' //数据接口
|
|
, url: '../Administrator/userMsg' //数据接口
|
|
, page: true //开启分页
|
|
, cols: [[ //表头
|
|
{field: 'id', title: 'ID', width: 80, sort: true, fixed: 'left'}
|
|
, {field: 'account', title: '用户名', width: 80}
|
|
, {field: 'password', title: '性别', width: 80, sort: true}
|
|
, {field: 'tel', title: '城市', width: 80}
|
|
, {field: 'email', title: '签名', width: 177}
|
|
, {field: 'status', title: '积分', width: 80, sort: true}
|
|
|
|
]]
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|