penambahan fitur row size and export
This commit is contained in:
@@ -143,13 +143,13 @@
|
|||||||
let dataVilla: Villa[] = [];
|
let dataVilla: Villa[] = [];
|
||||||
let allRows: TimesheetDisplay[] = [];
|
let allRows: TimesheetDisplay[] = [];
|
||||||
let totalItems = 0;
|
let totalItems = 0;
|
||||||
let rowsPerPage = 20;
|
let rowsPerPage = 10;
|
||||||
let showModal = false;
|
let showModal = false;
|
||||||
let isEditing = false;
|
let isEditing = false;
|
||||||
let currentEditingId: string | null = null;
|
let currentEditingId: string | null = null;
|
||||||
let newTsdata: Record<string, any> = {};
|
let newTsdata: Record<string, any> = {};
|
||||||
let selectedMonth: number | null = null;
|
let selectedMonth: number | null = new Date().getMonth() + 1; // 1-12
|
||||||
let selectedYear: number | null = null;
|
let selectedYear: number | null = new Date().getFullYear(); // Current year
|
||||||
let employees: Employee[] = [];
|
let employees: Employee[] = [];
|
||||||
let villas: Villa[] = [];
|
let villas: Villa[] = [];
|
||||||
let form = {
|
let form = {
|
||||||
@@ -962,6 +962,27 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="space-x-2">
|
<div class="space-x-2">
|
||||||
|
<label for="rowsPerPage" class="text-sm">Rows per page:</label>
|
||||||
|
<select
|
||||||
|
id="rowsPerPage"
|
||||||
|
class="border border-gray-300 px-2 py-1 rounded text-sm"
|
||||||
|
bind:value={rowsPerPage}
|
||||||
|
on:change={() => {
|
||||||
|
currentPage = 1; // Reset to first page on change
|
||||||
|
fetchTimeSheets(
|
||||||
|
currentVillaFilter,
|
||||||
|
currentSearchTerm,
|
||||||
|
sortColumn,
|
||||||
|
sortOrder,
|
||||||
|
0,
|
||||||
|
rowsPerPage,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{#each [10, 20, 50, 100] as option}
|
||||||
|
<option value={option}>{option}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
<button
|
<button
|
||||||
class="px-3 py-1 rounded border border-gray-300 bg-white hover:bg-gray-100 disabled:opacity-50"
|
class="px-3 py-1 rounded border border-gray-300 bg-white hover:bg-gray-100 disabled:opacity-50"
|
||||||
on:click={() => goToPage(currentPage - 1)}
|
on:click={() => goToPage(currentPage - 1)}
|
||||||
|
|||||||
Reference in New Issue
Block a user