[英]my web app looks different on server and works perfectly on localhost
i'm using datatables with codeigniter and it looked like this on localhost datatables on localhost 我正在使用带有codeigniter的数据表,并且在本地主机上的本地数据表上看起来像这样
and looked like this on server, i can't get the columns on the right side even if i enabled scrollX datatables on server 并在服务器上看起来像这样,即使我在服务器上启用了scrollX datatables ,我也无法获得右侧的列
my java-script code 我的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 }); } });
检查名称旁边的按钮的图像路径。(+)和(-)图像路径。
I can not understand well at all. 我根本听不懂。
If the problem is that you can not get the data on the server, check your config data in application/config/database.php 如果问题是无法在服务器上获取数据,请在application / config / database.php中检查配置数据
$db['default']['hostname'] = "host";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = "mysqli";
If your CONECCION is correct, then the problem is in your model or your controller, eg 如果您的CONECCION是正确的,则问题出在您的型号或控制器上,例如
controller.php controller.php
function do_somthing(){
$this->load->library('database');
$this->load->model('model_file');
$info = $this->model_file->get_data();
var_dump($info);
}
model_file.php model_file.php
function get_data(){
return $this->db->get('table')->result();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.