<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="themes/icon.css" />
<link href="css/demo.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="js/jquery.easyui.min.js" type="text/javascript"></script>
<script src="js/Common.js" type="text/javascript"></script>
</head>
<body class="easyui-layout">
    <div id="dg"  style="height:100%;">
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        setTimeout(function () {
            $(window).resize(function () {
                $("#dg").datagrid("resize", { width: $("body").width()+"px" });
            });
            $('#dg').css("height", $(window).height()+ "px");
            $('#dg').datagrid({
                loadMsg: "数据加载中，请稍后……",
                nowrap: false,
                collapsible: true,
                showFooter: true,
                striped: true,
                url: 'UserHandler.ashx?cmd=load&label=userlist<% if(Request["dept"]!=null)Response.Write("&dept="+Request["dept"].ToString()); %>',
                pageList: [10, 20, 30, 40, 50],
                pageSize: 20,
                sortName: 'uusername',
                sortOrder: 'desc',
                remoteSort: true,
                fitColumns: true, 
                pagination: true,
                idField: 'id',
                columns: [[
                { field: 'uusername', title: '用户名', width: 150, align: 'left', sortable: true },
                { field: 'fn', title: '资源数', width: 150, align: 'center', sortable: true },
                { field: 'spacesize', title: '空间大小', width: 150, align: 'center', sortable: true },
                { field: 'spacetotal', title: '共用空间', width: 150, align: 'center', sortable: true }
            ]],
                rownumbers: true,
                onLoadSuccess: function (res) {
                }
            });
            $("#dg").datagrid("getPager").pagination({
                beforePageText: '第', //页数文本框前显示的汉字  
                afterPageText: '页    共 {pages} 页',
                displayMsg: '当前显示从第{from}条到{to}条 共{total}条记录',
                onBeforeRefresh: function (pageNumber, pageSize) {
                    $(this).pagination('loading');
                }
            });
        }, 200);
    });
</script>
