我正在尝试用Dynatable加载json,数据看起来不错,但是不能排序,有什么问题吗?
这是我的JavaScript:
$(document).ready(function() {
var dynatable = $('table').dynatable({
dataset: {
ajax: true,
ajaxOnLoad: true,
ajaxUrl: 'people.json',
records: [],
perPageDefault: 4,
perPageOptions: [4,6,8,10]
},
params: {
records: 'People'
}
}).data("dynatable");
});
和下表:
<table>
<thead>
<tr>
<th>NAME</th>
<th>ADDRESS</th>
</tr>
</thead>
<tbody>
</tbody>
</table>发布于 2014-03-26 23:44:15
将table html标记更改为
<table id="myTable">将您的javascript更改为:
$(document).ready(function() {
$('#myTable').dynatable({
dataset: {
ajax: true,
ajaxOnLoad: true,
ajaxUrl: 'people.json',
records: [],
perPageDefault: 4,
perPageOptions: [4,6,8,10]
},
params: {
records: 'People'
}
});
});https://stackoverflow.com/questions/21914472
复制相似问题