角ui.grid得到嵌套行 [英] Angular ui.grid get nested rows

查看:167
本文介绍了角ui.grid得到嵌套行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过在过去的几个小时才能到达ui.grid显示一个行内嵌套表。

I've tried for the last few hours to get ui.grid to display a nested table inside one row.

$scope.gridOptions.columnDefs = [
    {name: 'id'},
    {name: 'categoryName'},
    {name: 'products', cellTemplate: '<div ui-grid="grid.appScope.gridOptions.data"></div>'}
  ];

每行可以没有,有一个或多个产品,但我不能让我的产品来显示。

Each row can have none, one or multiple products, but I can't get my products to display.

我请求通过AJAX JSON文件,但用于演示目的我做了它是静态的。
这里的包机 http://plnkr.co/edit/aXgXFZQL4xgVtTNH3y2S?p=$p$ PVIEW

I'm requesting the json file via ajax, but for demo purposes I've made it static. Here's the plucker http://plnkr.co/edit/aXgXFZQL4xgVtTNH3y2S?p=preview

由于提前

推荐答案

是否值得考虑这个,而不是扩展模块:的 http://ui-grid.info/docs/#/tutorial/306_expandable_grid

Is it worth considering the expandable module for this instead: http://ui-grid.info/docs/#/tutorial/306_expandable_grid

您目前正在服用可能给人以行高的难度,如果产品的数量是可变的,而扩展将使行的可变数量的方法。根据你的口味,拓展能力和倒塌可能是有益的,它给房间把每个产品的更多信息。

The approach you're currently taking will likely give difficulty with row height if the number of products is variable, whereas expandable would allow variable numbers of rows. Depending on your taste, the ability to expand and collapse may be beneficial, and it gives room to put more information about each product.

这篇关于角ui.grid得到嵌套行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆