私はangularjsに取り組んでいます、私はテーブルの最後の行に特定のレコードを持って来るカスタムフィルタを使用する必要があります。しかし、それをやっていない。特定のレコードをAngularjsのカスタムフィルターを使用してテーブルの最後の行に移動するにはどうすればよいですか?
CollectApp.filter('orderByValue', function() {
//$scope.reverse = true;
alert("Rajini");
return function(items, field) {
var filtered = [],
filteredX = [];
angular.forEach(items, function(p) {
if (p.pseudoBucket == ">90") {
filteredX.splice(0, 0, p);
} else if (p.pseudoBucket.indexOf(">") == -1) {
filtered.push(p);
} else {
filteredX.push(p);
}
});
angular.forEach(filtered, function(p) {
filteredX.push(p);
});
return filteredX;
//console.log("hi");
};
});
そして、私は今取得していた出力のイメージを共有してみましょう。ここでは
は私が
<table class="table table-bordered">
<thead ng-hide="content == 'true'">
<tr>
<th th-sort by="order" reverse="reverse" order="'bucket'">Bucket</th>
<th th-sort by="order" reverse="reverse" order="'product'">Product</th>
<th th-sort by="order" reverse="reverse" order="'countOfAllocatedAccount'">Allocated # </th>
<th th-sort by="order" reverse="reverse" order="'countOfCollectedAccount'">Collected #</th>
<th th-sort by="order" reverse="reverse" order="'countOfPendingCollectionOfAccounts'">Pending #</th>
</tr>
</thead>
<thead ng-show="content == 'true'">
<tr>
<th th-sort by="order" reverse="reverse" order="'bucket'">Bucket</th>
<th th-sort by="order" reverse="reverse" order="'product'">Product</th>
<th th-sort by="order" reverse="reverse" order="'sumOfAllocatedAccount'">Total Allocated Amount</th>
<th th-sort by="order" reverse="reverse" order="'sumOfCollectedAccount'">Total Collected Amount</th>
<th th-sort by="order" reverse="reverse" order="'sumOfPendingAllocatedAndCollectedAmounts'">Total Pending Amount </th>
</tr>
</thead>
<tbody>
<tr ng-hide="content == 'true'" ng ng-repeat='p in view_data | orderByValue'>
<td><span>{{p.pseudoBucket}}</span></td>
<td><span>{{p.product}}</span></td>
<td><span>{{p.countOfAllocatedAccount}}</span></td>
<td><span>{{p.countOfCollectedAccount}}</span></td>
<td><span>{{p.countOfPendingCollectionOfAccounts}}</span></td>
</tr>
<tr ng-show="content == 'true'" ng-repeat='p in view_data'>
<td><span >{{p.pseudoBucket}}</span></td>
<td><span>{{p.product}}</span></td>
<td><span>{{p.sumOfAllocatedAccount}}</span></td>
<td><span>{{p.sumOfCollectedAccount}}</span></td>
<td><span>{{p.sumOfPendingAllocatedAndCollectedAmounts}}</span></td>
</tr>
</tbody>
</table>
とカスタムフィルタを使用していHtml
とscript
です。
"> 90" "を最終行に持っていきたいと思います。誰でも助けてくれますか?
最終列であることと思いますか? – inoabrian
@ inoabrian私は説明のために出力画像を共有しました。最初の4つのレコードは "> 90"の値です。最後の列にその値を表示する必要があります。 –
最後の行ですか?したがって、上部のセクションは1〜30で、テーブルの下部は> 90ですか? – JokerDan