On localhost the datatable serverside is working fine. But after hosting on Godaddy it isn't

On localhost the datatable serverside is working fine. But after hosting on Godaddy it isn't

abdul_lkabdul_lk Posts: 1Questions: 1Answers: 0
edited June 1 in DataTables

I've got around 41,600 odd entries. It's working fine on localhost but after hosting on Godaddy I'm getting an error as


Find my code below

<script type="text/javascript">

$(document).ready(function() {

  $('#example1').DataTable({
        "ajax": {
            url : "<?php echo site_url("get_items"); ?>",
            type : 'GET'
        },
        "columnDefs": [
            {
              "render" : function(data,type,row){
                var inputid = row[0];
                var detail_url = '<?php echo site_url("view_school_details/");?>';
                var detail_edit_url = '<?php echo site_url("edit_school/");?>'; 
                var detail_edit_url_veri = '<?php echo site_url("verification_school/");?>'; 
                  
                return '<a href="'+detail_edit_url+'/'+inputid+'" class="btn btn-primary btn-sm"><i class="fas fa-edit"></i></a> <a href="'+detail_url+'/'+inputid+'" class="btn btn-warning btn-sm" target="_blank"><i class="fas fa-external-link-alt"></i></a> <a href="'+detail_edit_url_veri+'/'+inputid+'" class="btn btn-success btn-sm" target="_blank"><i class="fas fa-check"></i></a> <a class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModalDelete" class="btn btn-danger btn-sm"><i class="fa fa-times-circle" aria-hidden="true"></i></a>'
              },
              "targets" : 5
            },
            {
              "render" : function(data,type,row){
                var packs = row[4];
                if(packs == "Not Verified"){
                    return '<div style="margin:10px;"></div><span class="label label-danger" style="font-size: 10px;text-transform: uppercase;">'+ packs +'</span>'
                }else{
                    
                return '<div style="margin:10px;"></div><span class="label label-success" style="font-size: 10px;text-transform: uppercase;">'+ packs +'</span>'
                    
                }
                
              },
              "targets" : 4
            }
          ],
        
         "order": [[ 0, "desc" ]]
    });
    
    
      $('#example1').on('click', 'tr', function(){
            // var jsData = jsTable.fnGetData(this);  <== fnGetData deprecated!!!
            jsTable = $('#example1').DataTable();
            var jsData = jsTable.row(this).data();
             $('#accUserId').text(jsData[1]);
            $('#accUserName').val(jsData[0]);
        })
        // =====================================================

});

</script>
    

Answers

  • colincolin Posts: 12,098Questions: 0Answers: 2,054

    It's hard to tell, but it looks like it may have timed out - it would be worth considering serverSide. If that doesn't help, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.