jquery easyUI 的datagrid在html里能正常加载数据,但同样的代码,在asp.net里不能正常加载,这是怎么回事
代码如下:<headrunat="server"><title></title><linkhref="Scripts/themes/default/easyui.css"...
代码如下:
<head runat="server">
<title></title>
<link href="Scripts/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="Scripts/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="Scripts/themes/default/datagrid.css" type="text/css" />
<script type="text/javascript" src="Scripts/jquery-1.6.3rc1.js"></script>
<script src="Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#test').datagrid({
title: 'jQuery EasyUI---DataGrid',
iconCls: 'icon-save',
width: 500,
height: 350,
nowrap: false,
striped: true,
url: 'datagrid_data.json',
sortName: 'ID',
sortOrder: 'desc',
idField: 'ID',
frozenColumns: [[
{ field: 'ck', checkbox: true },
{ title: 'ID', field: 'ID', width: 80, sortable: true }
]],
columns: [[
{ title: '基本信息', colspan: 2 },
{ field: 'opt', title: '操作', width: 100, align: 'center', rowspan: 2,
formatter: function (value, rec) {
return '<span style="color:red">编辑 删除</span>';
}
}
], [
{ field: 'name', title: 'Name', width: 120 },
{ field: 'addr', title: 'Address', width: 120, rowspan: 2, sortable: true }
]],
pagination: true,
rownumbers: true,
singleSelect: false,
toolbar: [{
text: '添加',
iconCls: 'icon-add',
handler: function () {
alert('添加数据')
}
}, '-', {
text: '保存',
iconCls: 'icon-save',
handler: function () {
alert('保存数据')
}
}]
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<table id="test"></table>
</form>
</body> 展开
<head runat="server">
<title></title>
<link href="Scripts/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="Scripts/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="Scripts/themes/default/datagrid.css" type="text/css" />
<script type="text/javascript" src="Scripts/jquery-1.6.3rc1.js"></script>
<script src="Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#test').datagrid({
title: 'jQuery EasyUI---DataGrid',
iconCls: 'icon-save',
width: 500,
height: 350,
nowrap: false,
striped: true,
url: 'datagrid_data.json',
sortName: 'ID',
sortOrder: 'desc',
idField: 'ID',
frozenColumns: [[
{ field: 'ck', checkbox: true },
{ title: 'ID', field: 'ID', width: 80, sortable: true }
]],
columns: [[
{ title: '基本信息', colspan: 2 },
{ field: 'opt', title: '操作', width: 100, align: 'center', rowspan: 2,
formatter: function (value, rec) {
return '<span style="color:red">编辑 删除</span>';
}
}
], [
{ field: 'name', title: 'Name', width: 120 },
{ field: 'addr', title: 'Address', width: 120, rowspan: 2, sortable: true }
]],
pagination: true,
rownumbers: true,
singleSelect: false,
toolbar: [{
text: '添加',
iconCls: 'icon-add',
handler: function () {
alert('添加数据')
}
}, '-', {
text: '保存',
iconCls: 'icon-save',
handler: function () {
alert('保存数据')
}
}]
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<table id="test"></table>
</form>
</body> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询