Ich schreibe einen Tisch in eckigen. Aber wollte so implementieren, dass ich eine Zeile nach oben/unten bewegen kann, wenn ich auf/ab-Taste für eine bestimmte rohe drücken. Gibt es eine Funktion, die ich verwenden kann?Angular.js: Wie gehe ich in Angular von einem Tisch rauf/runter?
<div class="form-group" ng-show="editMode!=''">
<label for="editProdOjects" ng-class="{'col-sm-3':editMode=='addNew'}" class="col-md-2 control-label">Household Criteria</label>
<div ng-class="{'col-sm-9':editMode=='addNew'}" class="col-md-10">
<table class="table table-bordered table-striped table-hover table-condensed">
<thead><th>id</th><th>type</th><th>quantity</th><th>critical</th><th>page count</th><th>paper stock</th><th>outer envelope</th><th></th><th></th><th></th></thead>
<tbody>
<tr ng-repeat="track in editProdOjects">
<td>{{track.id}}</td>
<td>{{track.type}}</td>
<td>{{track.quantity}}</td>
<td>{{track.critical}}</td>
<td>{{track.pageCount}}</td>
<td>{{track.paperStock}}</td>
<td>{{track.outerEnvelope}}</td>
<td>
<button class="btn btn-danger btn-sm" data-style="zoom-in" ng-click="somefunction1()" title="Move Up">
<span class="glyphicon glyphicon-arrow-up"></span>
</button>
</td>
<td>
<button class="btn btn-danger btn-sm" data-style="zoom-in" ng-click="somefunction()" title="Move Down">
<span class="glyphicon glyphicon-arrow-down"></span>
</button>
</td>
<td>
<button class="btn btn-danger btn-sm" data-style="zoom-in" ng-click="editProductbomOjects.splice($index,1)" title="Delete">
<span class="glyphicon glyphicon-remove"></span>
</button>
</td>
</tr>
<tr>
<td colspan="10">
<button class="btn btn-primary btn-sm" ng-click="editProductbomOjects.push({'key':'','value':''})" title="Add Value">
<span class="glyphicon glyphicon-plus"></span> Add Value
</button>
</td>
</tr>
</tbody>
</table>
</div>
Jede Hilfe oder Anregung?
Sie wollen in eine andere Zeile wechseln, wenn man auf und ab drückt? –
Ändern Sie einfach den Index des Elements in den Daten, die Sie wiederholen. – Pytth