Pagination is not right
Pagination is not right
I've been searching for so many infomation from google/bing.
but I still don't understand what's wrong.
it shows "Showing 0 to 0 of 0 entries (filtered from 22 total entries)";
and the pagination only have "previous" and "next"(state are disable).
html:
<table id="example" class="table table-striped table-bordered"></table>
javascripts:
$(document).ready(function() {
$('#example').DataTable({
"columns": [
{ data: "Id", title: "ID", name: "Id" },
{ data: "Code", title: "过车序号", name: "Code" },
{ data: "EQUIP_CODE", title: "设备编号", name: "EQUIP_CODE" },
{ data: "LICENSE_PLATE_TYPE", title: "号牌种类", name: "LICENSE_PLATE_TYPE" },
{ data: "PLATE_NUMBER", title: "号牌号码", name: "PLATE_NUMBER" },
{ data: "CREATED_ON", title: "创建时间", name: "CREATED_ON" },
{ data: "State", title: "状态", name: "State" }
],
"processing": true,
"serverSide": true,
"ajax": {
dataType: "json",
url: "/SuspectVehicle/List",
method: "POST"
},
});
});
data from server:
{
"draw": 1,
"recordsTotal": 22,
"recordsFiltered": 0,
"data": [
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
},
{
"Code": "321201200406180179",
"EQUIP_CODE": "321200100056",
"PLATE_NUMBER": "XXXXXXX",
"LICENSE_PLATE_TYPE": "02",
"VEHICLE_TYPE": "02",
"WARNED_ON": null,
"Id": 347
}
]
}
This question has an accepted answers - jump to answer
Answers
Should probably be
"recordsFiltered": 22,
.See the manual for full details of those parameters.
Allan
i was set recordsFiltered = 22.
but the problem stll exists.
i got the solution. thx.