Data not binding in DataTable on pagination when using ajax to populate dataTable
<p>I am using a Data table to display a Document list. Where we can add new documents also. I am binding data to DataTable using Ajax call</p>

<pre><code> $.ajax({
            type: "POST",
            url: path,
            data: { Id: "0", MId: $("#MId").val() },
            dataType: "json",
            success: function (response) {

                var result = response.map(function (item) {
                    var result = [];

                    result.push(item.Id);
                    result.push(item.DocumentName);
                    result.push(item.Description);
                    result.push(item.UploadedOn);
                    result.push(item.UploadedBy);
                    result.push(item.UploadedDocument);
                    result.push(item.MId);

                    return result;
                });
                for (var i = 0; i &lt; result.length; i++) {
                    result[i][0] = "&lt;span id='" + result[i][0] + "'&gt;" + result[i][1] + "&lt;/span&gt;";
                    result[i][1] = "&lt;span&gt;" + result[i][2] + "&lt;/span&gt;";
                    result[i][2] = "&lt;span&gt;" + result[i][3] + "&lt;/span&gt;";
                    result[i][3] = "&lt;span&gt;" + result[i][4] + "&lt;/span&gt;";
                    result[i][4] = "&lt;a href='" xxxxxxxx"&lt;/a&gt;";
                    result[i][5] = "XXXXXXXXXXXXX"&lt;/i&gt;&lt;/label&gt;";
                   t.row.add(result[i]);

                }

                $("#user-detail-datatable").DataTable().draw();

                $("#user-detail-datatable").DataTable().clear();
            },
            error: function (error) {

            }
        });
</code></pre>

<p>It is working perfect  if number of document is less than 10 but if it is more then onclick of the next button(pagination). It shows no data to display. and I am also unable to go back to the 1st page also.How to solve this issue . I am using bootstrap datatable. </p>

<p>TIA</p>