I am trying to work with jQuery's Datatable JS for my project from this link.
(我正在尝试通过此链接为我的项目使用jQuery的Datatable JS。)
I downloaded the complete library from the same source.
(我从同一来源下载了完整的库。)
All the examples given in the package seem to work fine, but when I try to incorporate them in my WebForms
,the CSS,JS do not work at all.(软件包中给出的所有示例似乎都可以正常工作,但是当我尝试将其合并到WebForms
,CSS,JS根本不起作用。)
Here is what I have done :
(这是我所做的:)
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="myTable" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<!-- table body -->
</tbody>
</table>
</div>
<script src="js/jquery.dataTables.js" type="text/javascript"></script>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#myTable').DataTable();
});
</script>
</form>
</body>
</html>
My file structure for the JS and CSS in my Solution looks as follows :
(我的解决方案中的JS和CSS文件结构如下:)
I have added all the necessary JS and CSS references as shown in the manual.
(我已经添加了所有必要的JS和CSS参考,如手册中所示。)
Still the rendering isn't as expected.(渲染仍然不符合预期。)
There is no CSS and even the JS doesn't work.(没有CSS,甚至JS也无法使用。)
Also in the console i get the following errors:
(同样在控制台中,我得到以下错误:)
ReferenceError: jQuery is not defined
TypeError: $(...).DataTable is not a function
I have still not bound any dynamic data here (like within a repeater or so) still it is not working.
(我仍然没有在这里绑定任何动态数据(例如在转发器之内),但仍然无法正常工作。)
Can someone please guide me in the right direction for this problem ?
(有人可以指导我解决这个问题的正确方向吗?)
ask by Abhishek Ghosh translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…