简体   繁体   English

如何在二维数组数据中使用ng-grid(来自AngularUI)?

[英]How to use ng-grid (from AngularUI) with two-dimensional array data?

I'd really like to use the AngularUI ng-grid module for my project, however all the examples show the grid data as an array of objects, where as my server-side endpoint returns an array of arrays like this: 我真的很想在我的项目中使用AngularUI ng-grid模块,但是所有示例都将网格数据显示为对象数组,其中,作为服务器端端点,它返回如下数组:

[[1842860, 1.8691, 5.2067], [2235242, 0.7141, 2.0789], [2235240, 1.2816, 3.8265]]

Attempting to use ng-grid w/ two-dimensional array data as given above doesn't work. 尝试使用上面提供的带有二维数组数据的ng-grid无效。 How can I use ng-grid with data of this nature without having to transform it? 如何将ng-grid与这种性质的数据一起使用而不必进行转换?

Thanks! 谢谢!

Ah ok, the problem was I was using AngularJS 1.3 which, when presented with a matrix of data as I indicated above, would barf on rendering the cells. 好的,问题是我使用的是AngularJS 1.3,当使用如上所述的数据矩阵呈现时,将无法渲染单元格。

Using AngularJS 1.2.x solved the problem. 使用AngularJS 1.2.x解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM