我正在将数据表与Codeigniter一起使用
它在本地主机上看起来像这样
datatables on localhost

并在服务器上看起来像这样,我无法获得右侧的列
即使我启用了scrollX
datatables on server

我的Java脚本代码



$(document).ready(function () {
        var oTable = $('#tb').dataTable({
            "bProcessing": true,
            "bServerSide": true,
            "bStateSave": true,
            "autoWidth": false,
            "colReorder": true,
            "responsive": true,
            "scrollX": true,
            "sAjaxSource": '<?php echo base_url(roleURIUser()); ?>/leads/viewdata',
            "bJQueryUI": false,
            "sDom": 'T<"clear">Rlfrtip',
            "tableTools": {
                "sSwfPath": "<?= locationPlugin('url'); ?>datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf"
            },
            "sPaginationType": "full_numbers",
            "iDisplayStart ": 10,
            "aoColumns": [{
                    "mData": "name"
                }, {
                    "mData": "mobile"
                }, {
                    "mData": "phone"
                }, {
                    "mData": "branch"
                }, {
                    "mData": "code"
                }, {
                    "mData": "email"
                }, {
                    "mData": "university"
                }, {
                    "mData": "faculty"
                }, {
                    "mData": "address"
                }, {
                    "mData": "date_created"
                }, {
                    "mData": "status"
                }, {
                    "mData": "comment"
                }, {
                    "mData": "date_followup"
                }],
            "aoColumnDefs": [
                {"bSearchable": false, "aTargets": [5, 6, 7, 8, 9, 10, 11, 12]},
                {"bSortable": false, "aTargets": [5, 6, 7, 8, 9, 11, 12]},
                {"width": "30%", "aTargets": [11]}
            ],
            "order": [[0, "desc"]],
            "oLanguage": {
                "sProcessing": "<img src='<?= locationUpload('url'); ?>/ajax-loader.gif'>"
            },
            "fnInitComplete": function () {
                //oTable.fnAdjustColumnSizing();
            },
            'fnServerData': function (sSource, aoData, fnCallback) {
                $.ajax
                        ({
                            'dataType': 'json',
                            'type': 'GET',
                            'url': sSource,
                            'data': aoData,
                            'success': fnCallback
                        });
            }
        });

最佳答案

检查名称旁边的按钮的图像路径。(+)和(-)图像路径。

10-08 03:33