forked from TFMM/silent-auction
feat: make winnersbyitem table sortable using list.js
This commit is contained in:
@@ -15,24 +15,24 @@
|
||||
<div class="container-xl">
|
||||
<div class="row row-cards">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card" id="winners-by-item-table">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-vcenter card-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item Number</th>
|
||||
<th>Item Description</th>
|
||||
<th>Winner</th>
|
||||
<th>Winning Bid</th>
|
||||
<th class="sort" data-sort="item-num">Item Number</th>
|
||||
<th class="sort" data-sort="item-desc">Item Description</th>
|
||||
<th class="sort" data-sort="winner">Winner</th>
|
||||
<th class="sort" data-sort="bid">Winning Bid</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="list">
|
||||
@foreach($winnersbyitem_results as $winner)
|
||||
<tr>
|
||||
<td>{{ $winner->items->item_assigned_num }}</td>
|
||||
<td>{{ $winner->items->item_desc }}</td>
|
||||
<td>{{ $winner->bidders->bidder_fname }} {{ $winner->bidders->bidder_lname }}</td>
|
||||
<td>${{ number_format($winner->winning_cost, 2) }}</td>
|
||||
<td class="item-num">{{ $winner->items->item_assigned_num }}</td>
|
||||
<td class="item-desc">{{ $winner->items->item_desc }}</td>
|
||||
<td class="winner">{{ $winner->bidders->bidder_fname }} {{ $winner->bidders->bidder_lname }}</td>
|
||||
<td class="bid">${{ number_format($winner->winning_cost, 2) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -44,6 +44,13 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
|
||||
<script>
|
||||
new List('winners-by-item-table', {
|
||||
valueNames: ['item-num', 'item-desc', 'winner', 'bid']
|
||||
});
|
||||
</script>
|
||||
@include('components.tomselect')
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user