"私は20
のレコードをナビゲーションタブに表示しましたが、各レコードに対してチェックボックスにcoloumnを追加しました。 、8チェックボックスを使用して、ナビゲーションタブの上にある "編集"ボタンをクリックすると、ユーザーが編集できるようにModal
画面に表示されるはずですチェックボックスを使用してユーザーの選択に基づいてモーダル画面上のデータを表示
もしレコードを選択した場合は、5, 8, 6
レコードはその特定の順序。
私はそれをgoogleしましたが、関連する投稿は見つかりませんでした。
<div ng-app="RecordApp" ng-controller="recordcontroller" class="container-fluid">
<div class="input-group">
<ul class="nav nav-tabs">
<li role="menu" class="active"><a href="#" data-toggle="tab" >User Data</a></li>
</ul>
<table class="table">
<thead>
<tr>
<th>
<a href="#">Select</a>
</th>
<th>
<a href="#" ng-click="SortBy = 'Test1'; Reverse = !Reverse;">Test1</a>
</th>
<th>
<a href="#" ng-click="SortBy = 'Test2'; Reverse = !Reverse;">Test2</a>
</th>
<th>
<a href="#" ng-click="SortBy = 'Test3'; Reverse = !Reverse;">Test3</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in Records | orderBy:SortBy:Reverse ">
<td>
<input type="checkbox" checked="checked" ng-model="record.Selected" ng-change="Checked(record)" />
</td>
<td>{{ record.Test1 }}</td>
<td>{{ record.Test2 }}</td>
<td>{{ record.Test3 }}</td>
</tr>
</tbody>
</table>
</div>
次は、ナビゲーションタブの下
$http.get(pageBaseUrl + "api/records").success(function (records) {
$scope.Records = records;
$scope.IsLoading = false;
});
を取り込むための私のAngularJs
コードされるボタンやモーダル画面のコードです:
<div class="input-group">
<button type="button" data-target="#editRecords" data-toggle="modal" class="btn btn-primary navbar-btn">
<span class="glyphicon glyphicon-floppy-disk"></span>
Edit Multiple Records
</button>
</div>
<div id="editRecords" class="modal" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h2>Edit Data For Selected Records </h2>
</div>
<div class="modal-body">
<table class="table-condensed table-striped">
<thead>
<tr>
<th>Test 1</th>
<th>Test 2</th>
<th>Test 3</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in Records | orderBy:SortBy:Reverse">
<td><input type="text" class="form-control input-sm" /></td>
<td><input type="text" class="form-control input-sm" /></td>
<td><input type="text" class="form-control input-sm" /></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="SaveRecords();">Save Records</button>
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="UnmarkForEdition()">
Cancel
</button>
</div>
</div>
</div>
</div>
編集用のボタンはどこですか?モーダルHTMLはどこですか? –
私の悪いです。ナビゲーションタブの上に表示されます。私は現在自分のコードで遊んでいるので、言及するのを忘れてしまった。 –
モーダルHTMLとボタンコードも共有できますか。 –