- 注册时间
- 2015-3-11
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 35
- 精华
- 0
- 帖子
- 10

|
请问这段代码哪里有问题吗?怎么还是显示不出来啊
本帖最后由 huaxia 于 2015-3-13 18:26 编辑
felt 发表于 2015-3-13 13:08 
1 先获取表头数据
2 通过表头数据生成表头
<div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;" url="countrys.txt" >
</div>
<a class="mini-button">tt</a>
<script type="text/javascript">
mini.parse();
function tt()
{
var datagrid1 = mini.get("datagrid1");
//datagrid1.url = "countrys.txt";
var columns = ' [ { type: "indexcolumn" }, { field: "text", width: 120, header: "员工账号" } ] ';
datagrid1.setColumns(columns);
datagrid1.load();}
请问这段代码哪里有问题吗?怎么还是显示不出来啊
countrys.txt 数据:
[
{ "id": "usa", "text": "美国" },
{ "id": "cn", "text": "中国" },
{ "id": "jp", "text": "日本" },
{ "id": "en", "text": "英国" },
{ "id": "de", "text": "德国" },
{ "id": "fr", "text": "法国" },
{ "id": "ca", "text": "加拿大" },
{ "id": "at", "text": "奥地利" },
{ "id": "ch", "text": "瑞士" }
]
|
|