jQuery MiniUI
标题:
DataGrid加载数据成功,但页面无表格数据显示
[打印本页]
作者:
shenshouer
时间:
2013-7-9 12:02:27
标题:
DataGrid加载数据成功,但页面无表格数据显示
页面代码如下:
<[url=]%@include[/url] file="../taglib_includes.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd
">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户列表</title>
<link href="../resources/css/demo.css" rel="stylesheet" type="text/css" />
<script src="../resources/js/boot.js" type="text/javascript"></script>
<!-- <script src="../resources/js/core.js" type="text/javascript"></script> -->
<!-- <script src="../resources/js/tongji.js" type="text/javascript"></script> -->
</head>
<body>
<div class="mini-toolbar" style="padding:2px;border:0;">
<table style="width:100%;">
<tr>
<td style="width:100%;">
<a class="mini-button" iconCls="icon-save" plain="true">保存</a>
<a class="mini-button" iconCls="icon-close" plain="true">关闭</a>
<span class="separator"></span>
<a class="mini-button" iconCls="icon-reload" plain="true">刷新</a>
</td>
<td style="white-space:nowrap;"><label style="font-family:Verdana;">名称: </label>
<input class="mini-textbox" />
<a class="mini-button" iconCls="icon-search" plain="true">查询</a>
</td>
</tr>
</table>
</div>
<div class="mini-fit" style="background:red;height:500px;">
<div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;"
url="../user/getUsers" idField="id" sizeList="[5,10,20,50]" pageSize="10">
<div property="columns">
<div type="indexcolumn" ></div>
<div field="organization_id" width="120" headerAlign="center" allowSort="true">组织</div>
<div field="username" width="100" align="center" headerAlign="center">账号</div>
<div field="password" width="100" allowSort="true">密码</div>
<div field="phone" width="100" allowSort="true">电话号码</div>
<div field="email" width="100" allowSort="true">电子邮件</div>
<div field="create_time" width="100" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">创建日期</div>
<div field="name" width="120" headerAlign="center" allowSort="true">姓名</div>
</div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();
grid.sortBy("create_time", "desc");
</script>
</body>
</html>
加载数据格式如下:
{"total":1,"data":[{"id":1,"organization_id":1,"username":"shenshouer","password":"123456","phone":"123456","email":"123456@163.com","create_time":1373215327000,"name":"测试账号"}]}
页面显示效果如下:
[attach]2321[/attach]
作者:
shenshouer
时间:
2013-7-9 12:03:22
有谁知道为什么吗?
作者:
felt
时间:
2013-7-9 12:11:27
加个css
<style type="text/css">
html, body{
margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
}
</style>
作者:
shenshouer
时间:
2013-7-9 12:18:19
felt 发表于 2013-7-9 12:11
加个css
html, body{
OK,现在已经正常显示了!多谢啊
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2