Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81909

Data fetching Url calling twice

$
0
0

data Fetching url calling twice. script attached.

$(document).ready(function () {
    $('#tCity').DataTable(
    {
        "order": [[2, "asc"]],
        "pagingType": "numbers",
        "columnDefs": [
            { "className": "text-center custom-middle-align", "targets": [0], "width": "7%", "searchable": false, "orderable": false },
            { "className": "text-center custom-middle-align", "targets": [1], "width": "10%", "searchable": true, "orderable": true, "visible": false },
            { "className": "text-left custom-middle-align", "targets": [2], "searchable": true, "orderable": true },
            { "className": "text-center custom-middle-align", "targets": [3], "width": "10%", "searchable": true, "orderable": true, "visible": false },
            { "className": "text-left custom-middle-align", "targets": [4], "searchable": true, "orderable": true },
            { "className": "text-center custom-middle-align", "targets": [5], "width": "8%", "searchable": false, "orderable": false },
        ],
        "language":
            {
                "processing": "<div class='overlay custom-loader-background'><i class='fa fa-cog fa-spin custom-loader-color'></i></div>"
            },
        "processing": true,
        "serverSide": true,
        "ajax":
            {
                "url": "City.aspx/GetCityList",
                "contentType": "application/json",
                "type": "GET",
                "dataType": "JSON",
                "data": function (d) { return d; },
                "dataSrc": function (json) {
                    json.draw = json.d.draw;
                    json.recordsTotal = json.d.recordsTotal;
                    json.recordsFiltered = json.d.recordsFiltered;
                    json.data = json.d.data;
                    return json.data;
                }
            },
        "columns": [
                    { "data": "RowNumber" },
                    { "data": "iCityId" },
                    { "data": "strCity" },
                    { "data": "iStateId" },
                    { "data": "strState" },
                    { "data": "Action" }
        ]
    });
});


Viewing all articles
Browse latest Browse all 81909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>