как получить таблицу с группой по id в bootstrap и angularjs - PullRequest
0 голосов
/ 22 сентября 2018

как получить Get Record Group мудро в Angularjs, как на картинке ниже, пожалуйста, помогите мне в этом ..

<table class="table table-striped table-bordered table-list" id="support_table">
    <thead>
        <tr class="active">

            <th>Voucher Code</th>
            <th>Agent Name</th>
            <th>Ref #</th>
            <th>Arrival Date</th>
            <th>City</th>
            <th>Hotel Name</th>
            <th>In Date</th>
            <th>Nights</th>
            <th>Out Date</th>
            <th>Pax</th>
            <th></th>
            <th></th>
            <th>Action</th>
            <th>Edit</th>
        </tr>
    </thead>
    <tbody>
        <tr class="active" ng-repeat="item in VocuharList ">
            <td>{{item.VoucherId}}</td>
            <td>{{item.Name}}</td>
            <td>{{item.AgentReference}}</td>
            <td>{{item.ArrivalDate | date:'dd-MM-yyyy'}}</td>
            <td>{{item.City}}</td>
            <td>{{item.HotelName}}</td>
            <td>{{item.InDate | date:'dd-MM-yyyy'}}</td>
            <td>{{item.Nights}}</td>
            <td>{{item.OutDate | date:'dd-MM-yyyy'}}</td>
            <td>{{item.Pax}}</td>
            <td></td>
            <td></td>

            <td><button id="viewreport" ng-click="AddRoom(item)" type="button" class="btn yellow btn-outline btn-circle btn-xs  m-b-10">View
                    Report</button></td>
            <td><a target="_self">Edit </a></td>
        </tr>

    </tbody>
</table>

Я хочу, как на картинке ниже

enter image description here

, но текущая таблица, как показано ниже :( Я хочу группу, а затем показать информацию об отеле

enter image description here

1 Ответ

0 голосов
/ 22 сентября 2018

Вы можете изменить строку, как указано выше, сгруппировать по

<tr class="active" ng-repeat="item in VocuharList | groupBy : 'VoucherId' ">

И ввести угловой фильтр в модуль

var app = angular.module('myApp', ['angular.filter']);

...