Datatabls only showing first 10 rows of 200 row table

Datatabls only showing first 10 rows of 200 row table

longestdrivelongestdrive Posts: 9Questions: 5Answers: 0

Hi
I've had my set up working for ages but now it only wants to show the first 10 rows and I can't see what's changed to make it do this. The data is pulled from a database via ajax and I can see all the rows in the data source

My initialisation is:

oTable = $('.datatable').dataTable({
        "bServerSide": false,
        "bDeferRender": false,
        "bProcessing": false,
        "sAjaxSource": "/siteuser/datatable",
        "sDom": "<'row'<'col-xs-6'l><'col-xs-6'f>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>",
        "sPaginationType": "bs_full",
        "oLanguage": {
            "sLengthMenu": "_MENU_ records per page"
        },
        "iDisplayLength": 10,
        "aaSorting": [
            [1, "asc" ]
        ],
        "aoColumns": [
            {'bSortable': true, 'sClass': 'text-center'}, //id
            {'bSortable': true}, //date
            {'bSortable': true}, //category
            {'bSortable': true, 'sClass': 'text-center'}, //valid+member
            {'bSortable': true, 'sClass': 'text-center'}, //valid+member
            {'bSortable': true, 'sClass': 'text-center'}, //valid+member
            {'bSortable': true, 'sClass': 'text-center'}, //disabled
            {'bSortable': false, 'sClass': 'text-center'} //actions
        ]
    });

The status only states showing 10 rows from 10

I've run the page through the debug tool and here's a link: http://debug.datatables.net/upaqej

I can't see any errors in the console so not sure what's creating this problem

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    sAjaxSource": "/siteuser/datatable",

    It is only returning 10 rows. It looks like it is also returning some server-side processing parameters, but you have bServerSide disabled in your code above.

    Allan

  • longestdrivelongestdrive Posts: 9Questions: 5Answers: 0

    Hi
    I've now managed to solve. I was convinced the data via Ajax included all the rows as the records count indicated the correct number.
    I drilled further and discovered an error in the php laravel package that forced a default record limit of 10 if no parameter set.
    I've now reverted to an earlier version of the package and all resolved.
    Not a databases issue but a data issue

    Thank you for the pointer

This discussion has been closed.