- 注册时间
- 2012-7-14
- 最后登录
- 2012-11-30
- 阅读权限
- 10
- 积分
- 15
- 精华
- 0
- 帖子
- 2
|
刚刚接触miniUI,请问各位大侠. 我的datagrid 为什么不显示数据,但能显示 total.记录总数. 这是为什么?请帮忙看看,小第感激不尽.
1.Json 数据格式如下:
{"total":2,
"data":[{"EmpName":"管理员","Password":"1","IsEnable":true,"od":1,"ID":1,"DepartName":"资讯部","EmpNo":"a"},
{"EmpName":"测试员","Password":"1","IsEnable":true,"od":2,"ID":2,"DepartName":"生产部","EmpNo":"t"}]
}
2. Url:指定 grid.txt .只显示total. 也不显示data.
3. HTML如下:
<div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" allowResize="true"
url="../data/AjaxService.aspx?method=LoadUser" multiSelect="true" idField="ID" >
<div property="columns">
<!--<div type="indexcolumn"></div> -->
<div type="checkcolumn" ></div>
<div field="ID" width="120" headerAlign="center" allowSort="true">ID</div>
<div field="EmpNo" width="120" headerAlign="center" allowSort="true">员工编号</div>
<div field="EmpName" width="120" headerAlign="center" allowSort="true">员工姓名</div>
<div field="DepartName" width="120" headerAlign="center" allowSort="true">部门名称</div>
<div field="Password" width="120" headerAlign="center" allowSort="true">密码</div>
<div field="IsEnable" width="120" headerAlign="center" allowSort="true">是否有效</div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();
</script>
|
|