2016-09-04 1 views
1

私の角プロジェクトでソート可能なテーブル行がありますが、行のソートにもquery-uiコード要素が含まれていて、最後の行を並べ替えることはできません。最後の行をNONソート可能にする

HTML

<div ng:controller="controller"> 
    <table style="width:auto;" class="table table-bordered"> 
     <thead> 
      <tr> 
       <th>Index</th> 
       <th>Count</th> 
      </tr> 
     </thead> 
     <tbody ui:sortable ng:model="list"> 
      <tr ng:repeat="item in list" class="item" style="cursor: move;"> 
       <td>{{$index}}</td> 
       <td>{{item}}</td> 
      </tr> 
      <tr> 
       <td>Non Sortable</td> 
       <td>Non Sortable</td> 
      </tr> 
     </tbody>{{list}} 
     <hr> 
</div> 

コントローラここ

var myapp = angular.module('myapp', ['ui']); 

myapp.controller('controller', function ($scope) { 
    $scope.list = ["one", "two", "thre", "four", "five", "six"]; 
}); 

angular.bootstrap(document, ['myapp']); 

はJsFiddleに取り組んでいる:http://jsfiddle.net/valor_/fc7oftkn/

最後の行は非ソート可能にするために、どのように?追加情報が必要な場合は、私に知らせてください。事前にありがとう

答えて

1

次のように<tfoot>に移動してください。

<table style="width:auto;" class="table table-bordered"> 
    <thead> 
    <tr> 
     <th>Index</th> 
     <th>Count</th> 
    </tr> 
    </thead> 
    <tbody ui:sortable ng:model="list"> 
    <tr ng:repeat="item in list" class="item" style="cursor: move;"> 
     <td>{{$index}}</td> 
     <td>{{item}}</td> 
    </tr> 

    </tbody>{{list}} 
    <tfoot> 
    <tr> 
     <td>Non Sortable</td> 
     <td>Non Sortable</td> 
    </tr> 
    </tfoot> 
</table> 
+0

lol:D私はここで私のお尻を笑っています。どのように私はこれを把握していないxD Thx。それが許されるとすぐに私はあなたに答えを受け入れるでしょう –

+0

@Valor_ haha​​ :)ありがとう – DININDU

関連する問題