- 注册时间
- 2013-3-13
- 最后登录
- 2016-6-11
- 阅读权限
- 10
- 积分
- 172
- 精华
- 0
- 帖子
- 35
|
以下的代码无法显示数据,只显表头
var grid = new mini.DataGrid();
grid.set({
style: "width:100%;height:100%;",
showFooter: false,
columns: [
{ header: "员工帐号", field: "loginname", width: 120, headerAlign: "center" },
{ header: "姓名", field: "name", width: 120, headerAlign: "center" },
{ header: "性别", field: "gender", width: 100, align: "center" },
{ header: "工资", field: "salary", width: 100},
{ header: "年龄", field: "age", width: 100 }
]
});
grid.render(document.body);
var a=[];
var o = { loginname: 'ee11', name: 'q', gender: 'tt', salary: '222', age: '333' };
a.push(o);
grid.setData(a);
换成HTML的方式生成的就没事,
<div id="grid1" class="mini-datagrid" style="width:100%;height:400px;"
showFooter="false"
>
<div property="columns">
<div field="loginname">wwww</div>
<div field="name">wwww</div>
<div field="gender">wwww</div>
<div field="salary">wwww</div>
<div field="age">wwww</div>
</div>
</div>
//JS
mini.parse();
var grid = mini.get("grid1");
var a=[];
var o = { loginname: 'ee11', name: 'q', gender: 'tt', salary: '222', age: '333' };
a.push(o);
grid.setData(a);
|
|