easyui datagrid 绑定数据不显示
<linkrel="stylesheet"type="text/css"href="jquery-easyui-1.3.6/themes/default/easyui.c...
<link rel="stylesheet" type="text/css"
href="jquery-easyui-1.3.6/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
href="jquery-easyui-1.3.6/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.3.6/jquery.min.js"></script>
<script type="text/javascript"
src="jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/users.js"></script>
<body>
<script type="text/javascript">
function load(){
var data = '{"total":1,"rows":[{"id":"001","name":"哈哈哈","role":"系统管理员"}]}';
data = JSON.parse(data);//转换成json对象,必须的!!!不然有异常!!!
alert(data);
$('#dg').datagrid('loadData',data );
//$('#dlg').dialog('open');
}
load();
</script>
<table id="dg" class="easyui-datagrid" title="用户列表" data-options="singleSelect:true,collapsible:true"
style="width: 788px; height: 450px">
<thead>
<tr>
<th data-option="filed:'id',checkbox:true">id<th>
<th data-option="filed:'name',align:'center'">名字</th>
<th data-option="filed:'role',align:'center'">角色</th>
</tr>
</thead>
</table>
</body>
第一次接触easyui就没有人给我说下么 。。。。 展开
href="jquery-easyui-1.3.6/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
href="jquery-easyui-1.3.6/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.3.6/jquery.min.js"></script>
<script type="text/javascript"
src="jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/users.js"></script>
<body>
<script type="text/javascript">
function load(){
var data = '{"total":1,"rows":[{"id":"001","name":"哈哈哈","role":"系统管理员"}]}';
data = JSON.parse(data);//转换成json对象,必须的!!!不然有异常!!!
alert(data);
$('#dg').datagrid('loadData',data );
//$('#dlg').dialog('open');
}
load();
</script>
<table id="dg" class="easyui-datagrid" title="用户列表" data-options="singleSelect:true,collapsible:true"
style="width: 788px; height: 450px">
<thead>
<tr>
<th data-option="filed:'id',checkbox:true">id<th>
<th data-option="filed:'name',align:'center'">名字</th>
<th data-option="filed:'role',align:'center'">角色</th>
</tr>
</thead>
</table>
</body>
第一次接触easyui就没有人给我说下么 。。。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询