0

问题描述

jquery datatable ajax提示有多少条数据 但是没显示具体数据

问题出现的环境背景及自己尝试过哪些方法

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

$(document).ready(function() {

         $('#datatable_example').dataTable( {
              "processing":true,        
              "serverSide": true,
              "sAjaxSource":"http://localhost:8090/student/list",
             "sAjaxDataProp":"data",
      "columns": [
        {"data":'id'
        },
        {"data":'number'
        },
        {"data":'name'
        },
        {"data":'sex'},
        {"data":'age'
        },
        {"data":'cardId'
        },
        {"data":'brithday'
        },
        {"data":'joinTime'}, 
        {"data" :'political'},
        {"data":'nation'},
        {"data":'clazz'
        },
        {"data":'grade'
        },
        {"data":'major'
        },
        {"data":'college'
        },
        {"data":'length'},
        {"data":'email'
        },
        {"data":'telphone'},
        {"data":'home'},
        {"data":'pc'
        }
        ],
      
      
         "aoColumnDefs": [
        {
         sDefaultContent: '',
         aTargets: [ '_all' ]
          }
        ],
        
    "aaSorting": [[ 1, "asc" ]],
    "bPaginate": true,
    "sPaginationType": "full_numbers",
    "bJQueryUI": false, 
    "oLanguage": {
        "sLengthMenu": "每页显示 _MENU_ 条记录",
        "sZeroRecords": "对不起,没有匹配的数据",
        "sInfo": "第 _START_ - _END_ 条 / 共 _TOTAL_ 条数据",
        "sInfoEmpty": "没有匹配的数据",
        "sInfoFiltered": "(数据表中共 _MAX_ 条记录)",
        "sProcessing": "正在加载中...",
        "sSearch": "搜索:",
        "oPaginate": {
        "sFirst": "第一页",
        "sPrevious": " 上一页 ",
        "sNext": " 下一页 ",
        "sLast": " 最后一页 "
        }
        }
      }); 
         })
     

json数据:

{"status":"success","data":[{"id":3,"number":"04161110","name":"测试","sex":1,"age":20,"cardId":"441301199807262002","brithday":"1998-07-26","joinTime":"2016-09-01","political":0,"nation":"汉族","clazz":"2016级软件1班","grade":"2016级","major":"软件工程","college":"计算机科学与技术学院","length":"2","email":"958593442@qq.com","telphone":"13726280402","home":"中国人民共和国广东省","pc":"001261"},{"id":1,"number":"04161111","name":"张振邦","sex":1,"age":20,"cardId":"441301199807266123","brithday":"1998-07-26","joinTime":"2016-09-01","political":0,"nation":"汉族","clazz":"2016级软件1班","grade":"2016级","major":"软件工程","college":"计算机科学与技术学院","length":"2","email":"958593442@qq.com","telphone":"13726280402","home":"中国人民共和国广东省","pc":"001261"},{"id":4,"number":"04161116","name":"2号","sex":1,"age":20,"cardId":"441301199807260000","brithday":"1998-07-26","joinTime":"2016-09-01","political":1,"nation":"汉族","clazz":"2016级软件1班","grade":"2016级","major":"软件工程","college":"计算机科学与技术学院","length":"2","email":"958593442@qq.com","telphone":"13726280402","home":"中国人民共和国广东省","pc":"001261"}]}

你期待的结果是什么?实际看到的错误信息又是什么?

图片描述

一星 0
2019-06-12 提问
0 个回答

撰写答案

推广链接