我有下表的分组项目:



我想在特定组下的下拉行中显示每个项目。您介意帮助如何使用Angular JS做到这一点吗?

我正在使用单个JSON获取所有组和项目:

[
{"City":"NY",
"notes":"bla-bla",
"state":"Created",
,"description":"asdasdasda",
"locationId":1,
"waybillId":"",
"itemCount":3
"items":[{"itemId": "0001","status":"Created", "weight":23},
         {"itemId": "0002","status":"Created", "weight":23}
         {"itemId": "0003","status":"Created", "weight":23}
        ]

},

....

]


HTML:

<table class="table table-bordered">
    <thead>
        <tr>
            <th>#</th>
            <th>City</th>
            <th>Waybill</th>
            <th>Items</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        <tr ng-repeat="group in groupItems">
            <td>{{$index+1}}</td>
            <td>{{group.city}}</td>
            <td>{{group.waybillId}}</td>
            <td>{{group.itemCount}}</td>
            <td>
                <span class="label label-success">{{group.state}}</span>
            </td>
            <td>
                <button class="">Ungroup</button>
            </td>
        </tr>
    </tbody>
</table>

最佳答案

对于级别1,

<tbody data-ng-repeat="storedata in storeDataModel.storedata" data-ng-switch on="dayDataCollapse[$index]">

对于级别2,即第二个TR

<tr data-ng-switch-when="true">,其中具有第二级ng-repeat。

查看小提琴http://jsfiddle.net/Pixic/VGgbq/中是否有嵌套的手风琴,如桌子。

关于javascript - AngularJS的下拉行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26009522/

10-12 13:48