JQuery 插件DataTables,从服务端获取数据,分页出了问题。
我server-side提供的JSON是这样{"sEcho":3,"iTotalRecords":114,"iTotalDisplayRecords":114,"aaDa...
我server-side提供的JSON是这样
{
"sEcho": 3,
"iTotalRecords": 114,
"iTotalDisplayRecords": 114,
"aaData": [
[
"2011-10-7 0:01:00",
"\u77ed\u4fe1\u53d1\u9001",
""
],
.
.
.
[
"2012-7-2 17:56:40",
"\u77ed\u4fe1\u63a5\u6536",
""
]
]
}
在前台页面上写的脚本是这样的
function setHistory(phone) {
var table = $('#History').dataTable({
"sAjaxSource": "HistoryFaults.ashx?phoneNumber=" + phone,
"bInfo": false,
"bProcessing": true,
"bFilter": false,
"bPaginate": true,
"bLengthChange": false,
"iDisplayLength": 3,
"bServerSide": true,
"bRetrieve": true,
"bDestory": true,
"sZeroRecords": "此人暂无投诉记录!"
});
分页无效果,全在一个页面显示,搞得页面很长很丑。
请高手帮忙解决一下子 展开
{
"sEcho": 3,
"iTotalRecords": 114,
"iTotalDisplayRecords": 114,
"aaData": [
[
"2011-10-7 0:01:00",
"\u77ed\u4fe1\u53d1\u9001",
""
],
.
.
.
[
"2012-7-2 17:56:40",
"\u77ed\u4fe1\u63a5\u6536",
""
]
]
}
在前台页面上写的脚本是这样的
function setHistory(phone) {
var table = $('#History').dataTable({
"sAjaxSource": "HistoryFaults.ashx?phoneNumber=" + phone,
"bInfo": false,
"bProcessing": true,
"bFilter": false,
"bPaginate": true,
"bLengthChange": false,
"iDisplayLength": 3,
"bServerSide": true,
"bRetrieve": true,
"bDestory": true,
"sZeroRecords": "此人暂无投诉记录!"
});
分页无效果,全在一个页面显示,搞得页面很长很丑。
请高手帮忙解决一下子 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询