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

Datatable not loading first time

$
0
0

i am submitting a form which performs backend operation. After that when i click to open a popup which has a datatable in it, it is not able to load during the first time, i have printed the ajax json response in the backend and that seems proper. when i close the popup and reopen it, it works perfectly fine. it also works for all subsequent times.

Please find my code below:

<script type="text/javascript">

$(document).ready(function() {  
    
    loadTable();
   
});

function loadTable(){
     $('#xyzTable').dataTable( {
            "processing": true,
            "serverSide": false,
            "responsive" : false,
            
            ajax: {
                "url": "${fetchURL}",
                "type": "post",
                "dataSrc": "",
                "dataType" : "json"
            },
            "columns" : [
                {"data":"<%=COL1%>"},
                {"data":"<%=COL2%>"},
                {"data":"<%=COL3%>"},
                {"data":"<%=COL4%>"},
                {"data":"<%=COL5%>"}
            ]
        });
}
</script>

Viewing all articles
Browse latest Browse all 82358

Trending Articles



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