Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ui网格可以';t显示数据,b.forEach不是函数_Javascript_Angularjs_Angular Ui Grid - Fatal编程技术网

Javascript ui网格可以';t显示数据,b.forEach不是函数

Javascript ui网格可以';t显示数据,b.forEach不是函数,javascript,angularjs,angular-ui-grid,Javascript,Angularjs,Angular Ui Grid,我定义了列,我定义了组,我从请求中获取数据,但在构建网格时,它在某个地方失败了 $scope.gridOptions={ 启用筛选:正确, TreeRowheaderwaysVisible:错误, columnDefs:[ {name:'suplierName',分组:{groupPriority:0},排序:{priority:0,方向:'desc'},宽度:'30%',单元格模板:{{COL_字段自定义过滤器}}, {name:'InvoiceNumber',width:'25%}, {n

我定义了列,我定义了组,我从请求中获取数据,但在构建网格时,它在某个地方失败了

$scope.gridOptions={
启用筛选:正确,
TreeRowheaderwaysVisible:错误,
columnDefs:[
{name:'suplierName',分组:{groupPriority:0},排序:{priority:0,方向:'desc'},宽度:'30%',单元格模板:{{COL_字段自定义过滤器}},
{name:'InvoiceNumber',width:'25%},
{name:'Description',width:'25%},
{name:'InvoiceDate',width:'40%',cellFilter:'date',键入:'date'},
{name:'CurrencyDate',width:'40%',cellFilter:'date',键入:'date'},
{name:'InvoiceTotal',width:'25%',cellFilter:'number',type:'number'},
{name:'InvoiceNotPayed',width:'25%',cellFilter:'number',type:'number'},
{name:'TotalPayment',width:'25%',cellFilter:'number',type:'number'}
],
onRegisterApi:函数(gridApi){
$scope.gridApi=gridApi;
}
};
$scope.gridOptions={
};
$http.get('http://11.141.111.111/server/api/reports/unpayedInvoicesReport/organization/a255f922-6a4b-11e4-a7ff-53ee038745a3/fromAccount/62386806-fb07-4821-a83b-eab0cc987778/toAccount/62386806-fb07-4821-a83b-eab0cc987778?dateTo=31%2F01%2F2015')
.成功(功能(数据)
{
console.log(数据)
对于(变量i=0;i}])
您需要从代码段中删除这一行(~24,25)

$scope.gridOptions = {
};

您已经定义了$scope.gridOptions,因此之前设置的所有内容都已被此设置为空。

在获取数据之前,您正在将空对象分配给
$scope.gridOptions