Jquery数据表值插入: - 我们如何获取和存储数据表值。?
Uncaught TypeError: Cannot read property 'length' of undefined
at jquery.dataTables.min.js:45
at i (jquery.dataTables.min.js:32)
at Object.success (jquery.dataTables.min.js:32)
at j (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at x (jquery.min.js:4)
at XMLHttpRequest.<anonymous> (jquery.min.js:4)
我在jquery datatable中显示数据时会出现错误,这背后的原因是什么?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="angular-datatables.min.js"></script>
<script src="jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="datatables.bootstrap.css">
<script>
var myAngApp = angular.module('myApp', ['datatables']);
myAngApp.controller('feedbackController', ['$scope','$http','DTOptionsBuilder','DTColumnBuilder',function ($scope,$http,DTOptionsBuilder,DTColumnBuilder){
$scope.vm={};
$scope.vm.dtColumns = [
DTColumnBuilder.newColumn(0).withTitle('Feedback Id'),
DTColumnBuilder.newColumn(1).withTitle('Feedback Action Id'),
DTColumnBuilder.newColumn(2).withTitle('Description'),
DTColumnBuilder.newColumn(3).withTitle('Email'),
DTColumnBuilder.newColumn(4).withTitle('Created Date')
]
$scope.vm.dtOptions = DTOptionsBuilder.newOptions().withOption('ajax',{
method: 'GET',
dataSrc:"aaData",
url: "http://localhost:8080/feedback/webapi/Feedbacks"
})
.withOption('pocessing',true)
.withPaginationType('full_numbers')
}]
);
</script>