私は、Angularと共に動作するJQuery tablesorterプラグインを使用しようとしています。 現在、並べ替えの列をクリックすると、テーブルの幅と構造全体が変更され、ng-repeat式の新しい行が作成されます。AngularjsでjQuery tableSorterプラグインを使用する
$(document).ready(function() {
$("#check").tablesorter();
});
<table id="check" class="table table-bordered table-striped table-condensed table-hover tablesorter" cellspacing="1">
<thead>
<tr>
<th class="header">Product Code#</th>
<th class="header">Item Description#</th>
<th class="header">Unit Cost#</th>
</tr>
</thead>
<tbody>
<tr ng:repeat="i in itemresponse" >
<td><a href="#/ItemSearch/{{i._ItemID}}" >{{i._ItemID}}</a></td>
<td>{{i.PrimaryInformation._ShortDescription}}</td>
<td>{{i.PrimaryInformation._UnitCost}}</td>
</tr>
</tbody>
</table>
まず、tablesorter呼び出しをディレクティブに移動します。 ng:repeatが呼び出された後に呼び出されるディレクティブの優先順位を変更することができます。 http://youtu.be/iB7hfvqyZpg –
を参照してください。http://docs.angularjs.org/api/ng.filter:orderByの例をご覧ください。TablesorterなしでAngularJSを使用してソート可能なテーブルを作成することは可能です。 –
これは万一の場合に役立ちますか?http://plnkr.co/edit/VOf0DjZiKA2VxrWUDUgj?p=preview – eugenekgn