delete button added
This commit is contained in:
parent
92351c0bc1
commit
e70ffa85a1
|
@ -11,7 +11,8 @@ class Table extends Component
|
||||||
public $rows = []; // Data rows for the table
|
public $rows = []; // Data rows for the table
|
||||||
public $selected = []; // Selected row IDs
|
public $selected = []; // Selected row IDs
|
||||||
public $addRoute = null; // Route for adding new rows (optional)
|
public $addRoute = null; // Route for adding new rows (optional)
|
||||||
public $hasAddButton = true; // Whether the 'Add' button is shown
|
public $hasAddButton = true;
|
||||||
|
public $hasDelete = true; // Whether the 'Add' button is shown
|
||||||
public $selectAll = false; // Whether 'Select All' is active
|
public $selectAll = false; // Whether 'Select All' is active
|
||||||
public $hasCheckbox = true; // Whether checkboxes are shown for row selection
|
public $hasCheckbox = true; // Whether checkboxes are shown for row selection
|
||||||
public $hasActions = false; // Whether action buttons (like Edit/Delete) are shown
|
public $hasActions = false; // Whether action buttons (like Edit/Delete) are shown
|
||||||
|
|
|
@ -99,6 +99,14 @@
|
||||||
@endforelse
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<!-- Delete Button -->
|
||||||
|
@if($hasDelete)
|
||||||
|
<button wire:click="deleteSelected"
|
||||||
|
class="mt-4 px-4 py-2 bg-red-500 text-white rounded-md hover:bg-red-600 cursor-pointer"
|
||||||
|
@if (empty($selected)) disabled @endif>
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
<!-- Modal for Viewing / Editing Row -->
|
<!-- Modal for Viewing / Editing Row -->
|
||||||
@if ($showModal)
|
@if ($showModal)
|
||||||
|
|
|
@ -14,5 +14,6 @@
|
||||||
:hasCheckbox="false"
|
:hasCheckbox="false"
|
||||||
:hasActions="true"
|
:hasActions="true"
|
||||||
:isViewPage="true"
|
:isViewPage="true"
|
||||||
|
:hasDelete="false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
|
@ -14,5 +14,6 @@
|
||||||
:hasCheckbox="false"
|
:hasCheckbox="false"
|
||||||
:hasActions="true"
|
:hasActions="true"
|
||||||
:isViewPage="true"
|
:isViewPage="true"
|
||||||
|
:hasDelete="false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,5 +14,6 @@
|
||||||
:hasActions="true"
|
:hasActions="true"
|
||||||
:isViewPage="false"
|
:isViewPage="false"
|
||||||
:addRoute="route('branch-create')"
|
:addRoute="route('branch-create')"
|
||||||
|
:hasDelete="false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
|
@ -1,15 +1,15 @@
|
||||||
<div>
|
<div>
|
||||||
{{-- Top Nav --}}
|
{{-- Top Nav --}}
|
||||||
@include('livewire.station-locator.top-nav.fuel')
|
@include('livewire.station-locator.top-nav.fuel')
|
||||||
<livewire:components.table
|
<livewire:components.table
|
||||||
:columns="[
|
:columns="[
|
||||||
['label' => 'Fuel Name', 'field' => 'fuel_name'],
|
['label' => 'Fuel Name', 'field' => 'fuel_name'],
|
||||||
['label' => 'Date Created', 'field' => 'date_created'],
|
['label' => 'Date Created', 'field' => 'date_created'],
|
||||||
['label' => 'Date Modified', 'field' => 'date_modified'],
|
['label' => 'Date Modified', 'field' => 'date_modified'],
|
||||||
]"
|
]"
|
||||||
:rows="$fuels"
|
:rows="$fuels"
|
||||||
:hasActions="true"
|
:hasActions="true"
|
||||||
:isViewPage="false"
|
:isViewPage="false"
|
||||||
:addRoute="route('fuel-create')"
|
:addRoute="route('fuel-create')"
|
||||||
/>
|
:hasDelete="false" />
|
||||||
</div>
|
</div>
|
|
@ -1,8 +1,8 @@
|
||||||
<div>
|
<div>
|
||||||
{{-- Top Nav --}}
|
{{-- Top Nav --}}
|
||||||
@include('livewire.station-locator.top-nav.station')
|
@include('livewire.station-locator.top-nav.station')
|
||||||
<livewire:components.table
|
<livewire:components.table
|
||||||
:columns="[
|
:columns="[
|
||||||
['label' => 'Station Code', 'field' => 'station_code'],
|
['label' => 'Station Code', 'field' => 'station_code'],
|
||||||
['label' => 'Station Name', 'field' => 'station_name'],
|
['label' => 'Station Name', 'field' => 'station_name'],
|
||||||
['label' => 'Branch Name', 'field' => 'branch_name'],
|
['label' => 'Branch Name', 'field' => 'branch_name'],
|
||||||
|
@ -11,9 +11,9 @@
|
||||||
['label' => 'Modified By', 'field' => 'modified_by'],
|
['label' => 'Modified By', 'field' => 'modified_by'],
|
||||||
['label' => 'Date Modified', 'field' => 'date_modified'],
|
['label' => 'Date Modified', 'field' => 'date_modified'],
|
||||||
]"
|
]"
|
||||||
:rows="$stations"
|
:rows="$stations"
|
||||||
:hasActions="true"
|
:hasActions="true"
|
||||||
:isViewPage="false"
|
:isViewPage="false"
|
||||||
:addRoute="route('station-create')"
|
:addRoute="route('station-create')"
|
||||||
/>
|
:hasDelete="false" />
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue