javascript - How show a group label in ng-table? -
anyone knows how create group in ng-table:
<div> <div ng-controller="contractscontroller" style="position: relative;background:whitesmoke; border:1px solid lightgray; border-radius:5px; margin-top:0px; margin-bottom:5px; height:330px;"> <button prevent-default ng-click="tableparams.sorting({});tableparams.filter({});" class="btn btn-deufol btn-sm pull-right" style="width:150px;margin: 2px;"><span class="glyphicon glyphicon-th"></span> alle anzeigen</button> <div style="margin-top: 6px;"> gruppieren nach: <select ng-model="groupby" style=" font-weight:bold;"> <option value="vppickup" label="abgeholt">abgeholt</option> <option value="vshier1" label="auftragsnummer">auftragsnummer</option> <option value="lastmodifieddate" label="bearbeitet am">bearbeitet am</option> <option value="orderno" label="bestellnummer">bestellnummer</option> <option value="locationname" label="standort">standort</option> <option value="stateid" label="status kiste">status kiste</option> <option value="vpreadyfordispatch" label="versandbereit">versandbereit</option> <option value="vpadate" label="vpa erstellung">vpa erstellung</option> </select> </div> <div id=container" class="scrollable-area table-responsive" style="position:relative;background:whitesmoke; margin-top:0px; margin-bottom:0px; height: 294px;"> <%-- sollte eigentlich eine animation zeigen ... --%> <div class="alert alert-info" ng-show="loading" style="text-align:center;">loading data ...</div> <table class="table" ng-table="tableparams" show-filter="true" fixed-table-headers> <tbody ng-repeat="group in $groups"> <tr class="ng-table-group"> <td colspan="{{$columns.length}}"> <a href="" ng-click="group.$hiderows = !group.$hiderows" style="color:#3d3d3d;"> <span class="glyphicon" ng-class="{ 'glyphicon-chevron-right': group.$hiderows, 'glyphicon-chevron-down': !group.$hiderows }"></span> <strong>{{ group.label }} {{ group.value }}</strong> </a> </td> </tr> <tr ng-hide="group.$hiderows" ng-repeat="data in group.data" ng-click="loadsingleview(data.vshier1, data.vshier2, data.kollinointern); setselected(data.id)" ng-class="{{selected}}"> </tr> </tbody> </table> </div> </div> </div>
by way angularjs shows group value. there way show group to?
example: if group date, angular shows group "01.12.2014", "02.12.2014" ....
example want: "vpa erstellung: 01.12.2014"
if has tip or solution, please me.
you can information group.data object items in group looking @ specific info on elements of group array (assuming field you're looking same items of group).
since won't have group without @ least 1 item, can info want first item in group. in example grouping field called "name" on "domain" object. ngtable simple showed {{group.value}} modified show
domain {{group.data[0].description}}: {{group.value}}
Comments
Post a Comment