Bug in Pagination when using ajax.data

Bug in Pagination when using ajax.data

trentrtrentr Posts: 3Questions: 1Answers: 0
edited August 2015 in Free community support

Hello,

For some reason, iDisplayStart is not being passed to the server when paging using ajax.data. iDisplayStart is undefined. Here's my code:

<div class="content" id="deliveryAccountDetails" >
                <table id="delivery_datatable" class="display"></table>
            <p>&nbsp;<p>
        </div>

<script>
        $(document).ready(function() {

                $('#delivery_datatable').dataTable( {
                                "processing": true
                                ,"serverSide": true
                                ,"columns": [
                                    { "title": "Name", "data": "accountName", width:"auto" }
                                ]
                                ,"ajax": {  
                                                "url": "/get_delivery?id=<%= id %>"
                                                ,"data": function( d ){
                                                    d.page  = d.draw;
                                                    d.limit = d.length;
                                                }
                                   }
                });

        });

</script>

Answers

  • trentrtrentr Posts: 3Questions: 1Answers: 0
    edited August 2015

    Hi,

    Can anyone help? I'm hoping it is a quick fix that I am just missing something.

    Thanks!

  • trentrtrentr Posts: 3Questions: 1Answers: 0
    edited August 2015

    I tried removing ajax.data and pagination still doesn't work. iDisplayStart and iDisplayLength are not being passed as a parameter. This seems to be a bug:

     $(document).ready(function() {
     
                    $('#delivery_datatable').dataTable( {
                                    "processing": true
                                    ,"serverSide": true
                                    ,"columns": [
                                        { "title": "Name", "data": "accountName", width:"auto" }
                                    ]
                                    ,"ajax": { 
                                                    "url": "/get_delivery?id=<%= id %>"
                                    }
                    });
     
            });
    
  • allanallan Posts: 63,360Questions: 1Answers: 10,447 Site admin

    iDisplayStart is a legacy parameter. It looks like you are using the new style - the parameters for which are listed in the documentation.

    Allan

This discussion has been closed.