per page ajax loading

per page ajax loading

lykadoodleslykadoodles Posts: 5Questions: 3Answers: 0
edited October 2014 in Free community support

Hi there! Good day.

Can I ask for some help? I have an existing table built with data tables.. And I was wondering to add a "lazy loading" feature to the table? Here's my existing ajax code:

$.ajax({
type: "GET",
url: "../api/podadmin", // the method we are calling
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {

                $('#imloading').fadeOut(1000);

                $.each(result, function (index, value) {
                    var value = value.split(",");


                    $('#AdminBody').append('<tr><td class="col-xs-1"><span class="line"></span><a class="DN" data-toggle="modal" data-target="#DNmodal"><b>' + value[1] +
                                        '</b></a></td><td class="col-xs-1"><span class="line"></span>' + value[2] +
                                        '</td><td class="col-xs-1"><span class="line"></span>' + value[3] +
                                        '</td><td class="col-xs-1"><span class="line"></span>' + value[4] +
                                        '</td><td class="col-xs-2"><span class="line"></span>' + value[5]  +
                                        '</td></tr>');

                })


                $("#tblAdmin").DataTable({ responsive: true, "order": [[0, "desc"]] });

            }
        });

I tried reading this but can't seem to find the pattern how to do it on my existing code.. http://datatables.net/examples/server_side/pipeline.html

Thanks for the guidance.

This discussion has been closed.