Datatable not loading first time

Datatable not loading first time

aritra2023aritra2023 Posts: 1Questions: 1Answers: 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>

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Have you followed the steps in the technical notes linked to in the error? That'll be the place to start. If so, what did you find?

    Colin

Sign In or Register to comment.