why the page length DataTable does not work when uploaded in cpanel, but in "localhost" success?

why the page length DataTable does not work when uploaded in cpanel, but in "localhost" success?

dearnawandearnawan Posts: 4Questions: 1Answers: 0

Hello, I am a student and had just learned about datatables. I've managed to make CRUD system in localhost but I am having trouble after uploading on the web online.
This is the code that I do:

var table1=$('#myTable1').DataTable( {

        "dom": '<"Top"fT>rt<"bottom"ip><"clear">',
        tableTools: {
            "sRowSelect": "os", 
            "aButtons": [
                "copy",
                "print",
                {
                    "sExtends":    "collection",
                    "sButtonText": "Save",
                    "aButtons":    [ "csv", "xls", "pdf" ]
                }
            ],
            "sSwfPath": "plugin/DataTables/swf/copy_csv_xls_pdf.swf"
        },
        "language": {
            "url": "https://cdn.datatables.net/plug-ins/1.10.7/i18n/Indonesian.json"
        },
        "sPaginationType":"full_numbers",
        "bLengthChange" : true,
        'iDisplayLength': 10,
        "processing": true,
        "serverSide": true,
        "ajax": "plugin/DataTables/php/server_processing_tam.php",
        "aaSorting": [[0, "desc"]],
        "fnRowCallback": function( nRow, aData ) {
            if ( aData[14] != "Tamu" ){
                $(nRow).addClass("cell_bio_sudah");
                }
            if ( aData[11] != "" && aData[11] != null )
                $(nRow).addClass("cell_bio_masih");
                
        },
        "fnCreatedRow": function (row, data, index) {
            $('td', row).eq(0).html(index + 1);
         },
        "columnDefs": [ {
                "targets": -1,
                "data": null,
                "orderable": false,
                "defaultContent": "<center><span class='buttonedit' id='buttonedit1' data-toggle='modal' data-target='#update1' data-toggle='modal'></span><span class='buttondelete' id='buttondelete1'></span></center>"
            },
            {
                "targets": [12],
                "orderable": false
            },
            {
                "targets": 
                    [ 
                        4  /*alamat*/ ,
                        5  /*TTL*/,
                        7  /*email*/,
                        8  /*facebook*/,
                        9  /*bb*/,
                        10 /*info*/,
                        11 /*followup*/ ,
                        13 /*waktu_training*/,
                        14 /*status*/
                    ],
                "visible": false,
                "searchable": false
            },
            {
                "targets": 'no-sort',
                "orderable" : false
            }
        ]

    });

    var listkursus= [
        <?php
            $query = mysql_query("SELECT * FROM tb_daftarkursus WHERE id_kursus != 00  ORDER BY id_kursus LIMIT 20");
            while ($row = mysql_fetch_assoc($query)) {
                $php_listkursus = $row["nama_kursus"];
                echo "'$php_listkursus',";
            }
        ?>
    ];

    yadcf.init(table1, [
        {column_number : 12,
            filter_default_label:"Pilih Kursus",
            filter_reset_button_text: false},
        {column_number : 15,  
            data: [
                "01",
                "02",
                "03",
                "04",
                "05",
                "06",
                "07",
                "08",
                "09",
                "10",
                "11",
                "12"],
                filter_default_label: "B", 
                filter_reset_button_text: false 
        },
        {column_number : 16,  
            data: [
                "2014",
                "2015",
                "2016",
                "2017",
                "2018",
                "2019",
                "2020"
                ],
                filter_default_label: "T", 
                filter_reset_button_text: false 
        }

    ], 'header');

I enter the following javascript:

<script src="<?php uppage();?>plugin/jquery/jquery-latest.min.js"></script>
<script src="<?php uppage();?>plugin/bootstrap/js/bootstrap.min.js"></script>
<script src="<?php uppage();?>plugin/bootstrap/js/bootstrap-datetimepicker.js"></script>
<script src="<?php uppage();?>plugin/bootstrap/js/bootstrap-datetimepicker.id.js"></script>
<script src="<?php uppage();?>plugin/sweetalert/dist/sweetalert.min.js"></script>
<script src="<?php uppage();?>plugin/toastr/js/toastr.js"></script>
<script src="<?php uppage();?>plugin/DataTables/js/jquery.dataTables.js"></script> 
<script src="<?php uppage();?>plugin/DataTables/js/dataTables.tableTools.js"></script>
<script src="<?php uppage();?>plugin/DataTables/js/jquery.dataTables.yadcf.js"></script>
<script src="<?php uppage();?>plugin/Highcharts/js/highcharts.js"></script>
<script src="<?php uppage();?>plugin/Highcharts/js/exporting.js"></script>
<script src="<?php uppage();?>js/grafikfilter.js"></script>
<script src="<?php uppage();?>plugin/Kendocombobox/js/kendo.all.min.js"></script>

But when executed there are no errors, by the way I use yadcf. Does it also have an effect?

this is the screenshot http://prntscr.com/96nh0p

sorry for my bad english :)

Answers

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    Hi,

    Regarding yadcf, you can comment out the code you use to init yadcf and see how and if at all it change anything for you.

    make sure you have uploaded all your file to your remote server and inspect chrome dev tools console, see maybe you'll notice some 404 file not found / etc

  • dearnawandearnawan Posts: 4Questions: 1Answers: 0

    Thank you daniel for the answer, all I have tried and the results are still the same

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    In that case it looks beyond the scope of what I can help you,

    But I think you should start from a really simple project deployment , something like a sort of hellow word, and then start adding stuff to it... and pinpoint what wrong...

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    We'd really need a link to a page demonstrating the issue to be able to offer any help.

    Allan

  • dearnawandearnawan Posts: 4Questions: 1Answers: 0

    the problem is iDisplaylength or pageLength, not limiting records.
    if I try what daniel_r said I don't have much time because the deadline is today.iam sorry..

  • dearnawandearnawan Posts: 4Questions: 1Answers: 0

    the problem is iDisplaylength or pageLength, not limiting records.
    if I try what daniel_r said I don't have much time because the deadline is today.iam sorry..

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    It appears to work for me: http://live.datatables.net/wabumago/1/edit .

    We can offer some help, but only if we have a test case showing the issue so we can debug it.

    Also note that since you are using server-side processing the limiting should be done by whatever is in "plugin/DataTables/php/server_processing_tam.php".

    Allan

This discussion has been closed.