Table always displays "Showing 0 to 0 of 0 entries (filtered from 26 total entries)"

Table always displays "Showing 0 to 0 of 0 entries (filtered from 26 total entries)"

GBLGBL Posts: 3Questions: 1Answers: 0
edited November 2015 in Free community support

http://debug.datatables.net/icokas

I'm using datatables 1.10 and the footer always displays as title. I'm doing server-side processing using ASP.NET and returning the result in JSON according to https://datatables.net/manual/server-side

I've included a debug at the top. What am I doing wrong here?

Here is my initialisation code

var table = $('#event-products').DataTable({
                "processing": true,
                "serverSide": true,
                "ajax": {
                    "dataType": "json",
                    "url": "@Url.Action("IndexAjaxList")",
                    "type": "POST",
                    "data": function(data) {
                        if ($('#meetingId').val() === '') {
                            data.meetingId = -1;
                        } else {
                            data.meetingId = $('#meetingId').val();
                        }
                    }
                },
                "columns": [
                    { "data": "Plus", "orderable": false },
                    { "data": "Confirmed", "orderable": false },
                    { "data": "Image", "orderable": false },
                    { "data": "Barcode1" },
                    { "data": "Barcode2" },
                    { "data": "Title" },
                    @if (!User.IsUserSupplier())
                    {
                        <text>{ "data": "SupplierName" },</text>
                    }
                    { "data": "SubCategoryDescp" },
                    { "data": "Options", "orderable": false }
                ],
                "order": [[5, "desc"]]
            });

This question has an accepted answers - jump to answer

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    I believe it has something to do with what your server response is, can you show us the response?

  • GBLGBL Posts: 3Questions: 1Answers: 0

    Hey jLinux, thanks for the response.

    I believe you can see the server response in the debug link at the top:
    http://debug.datatables.net/icokas <-- that one

    The response is under the Table tab -> Server Interaction.

    As far as I can see, the response looks like it it supposed to but maybe I am missing something.

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin
    Answer ✓

    "recordsFilter": 28,

    Should be:

    "recordsFiltered": 28,
    

    See server-side processing manual. I think that is probably the issue.

    Allan

  • GBLGBL Posts: 3Questions: 1Answers: 0

    Ah, so simple a thing. Thank you very much Allan.

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Ive dome that before, i keep uaing rowCreated instead of createdRow >.<

This discussion has been closed.