表没有被填充从Ajax调用使用数据表插件的jQuery
Table not being filled from Ajax Call using Datatables plug-in for jQuery
ajax请求返回以下数据
[{"ID":40,"Date":"'/Date(1407999600000)'/"},{"ID":39,"Date":"'/Date(1409036400000)'/"}
HTML是:
<table id="bookings-table" class="display">
<thead>
<tr>
<th>ID</th>
<th>Date</th>
</tr>
</thead>
<tfoot>
<tr>
<th>ID</th>
<th>Date</th>
</tr>
</tfoot>
</table>
javascript是
$(document).ready(function () {
$('#bookings-table').dataTable({
"ajaxSource": "/manager/Booking/GetBookings",
"columns": [
{ "data": "ID" },
{ "data": "Date" }
]
});
});
知道为什么表没有被填充吗
看看他们的文档,我相信你的json必须这样格式化。
{
"data": [
{
"ID": 40,
"Date": "'/Date(1407999600000)'/"
},
{
"ID": 39,
"Date": "'/Date(1409036400000)'/"
}
]
}
Javascript错误
$('#bookings-table').dataTable({
"ajax": {
"url": "/manager/Booking/GetBookings",
"dataSrc": ""
},
已排序的所有列现在绑定
相关文章:
- 如何暂停和重新启动jquery数据表插件
- 如何从网格数据表插件 jQuery 中清除数据
- 数据表插件异步加载数据
- 选择 (*) 替代 - 使用 jQuery 数据表插件
- IE 11中的数据表插件数据加载问题
- django的Jquery数据表插件
- 表没有被填充从Ajax调用使用数据表插件的jQuery
- 如何在数据表插件中隐藏类似的数据
- 数据表插件无法处理html表
- 数据表插件css不工作
- 如何使用Jquery数据表插件隐藏表格中的列
- Javascript数据表插件
- jQuery数据表插件-如何访问底层数据
- 在数据表插件jQuery中设置分页长度
- 使用jquery定义如何在基于网格的数据表插件中添加自定义链接按钮
- jQuery数据表插件iDisplayLength
- Ajax返回的数据没有绑定jquery数据表插件
- 使用数据表插件的当前页面排序
- 查找并用数据表插件替换单元格值
- jQuery数据表插件,动态创建的最后一列平均在fnRowCallBack是不可排序的