1
votes

I have a datatable which uses server side pagination with infinite scroll. So my pages loads as an when I scroll down the table. Now the default page size is 10. How can I override this number? I tried setting iDisplayLength:50, but didnt work.

ListDataTable= $("#ListDataPane_data").dataTable({
                 "iDisplayLength":50,
                "bFilter": true,
                "bServerSide": true,
                "sServerMethod": "POST",
                "sAjaxSource": ListResourcePaginationUrl,
                "bProcessing": true,
                "sPaginationType": "full_numbers",
                "bJQueryUI": false,
                "bDestroy": true,



                 "bScrollInfinite": true,
                 "sScrollY": "300px",
                 "sScrollX": "963px",
                 "fnServerParams": function (aaData) {
                    aaData.push(
                     { "name": "Status", "value": status}
                    );

                    });
                },

Please help.

3
Please provide some code. It's probably right to change a variable but it's hard to say which one. - tea2code
There you go.. I have pasted the code - Seeker

3 Answers

0
votes

It may be that the server doesn't respect the iDisplayLength value. In this case you must also update the server side.

0
votes

"iDisplayLength":50 works, I just had to clear the browser cache.

0
votes

you should call fnDraw method in DataTable after change iDisplayLength field value: table.fnSettings().iDisplayLength = 20; and table.fnDraw();