Pagination is not right

Pagination is not right

currentioncurrention Posts: 3Questions: 1Answers: 1
edited September 2016 in Free community support

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

  • allanallan Posts: 63,815Questions: 1Answers: 10,517 Site admin

    "recordsFiltered": 0,

    Should probably be "recordsFiltered": 22,.

    See the manual for full details of those parameters.

    Allan

  • currentioncurrention Posts: 3Questions: 1Answers: 1

    i was set recordsFiltered = 22.
    but the problem stll exists.

  • currentioncurrention Posts: 3Questions: 1Answers: 1
    Answer ✓

    i got the solution. thx.

This discussion has been closed.