Skip to main content

UI/UX Specification: Mandatory Row Numbers (STT) and Pagination for All CMS Tables

Last Updated: 16/07/2026
Type: UI/UX Standardization Spec β€” Table Controls
Scope: All Swizzled CMS Data Tables (excluding CMS Articles/Events which already implement this)
Severity: 🟠 Medium β€” Critical for usability, listing clarity, and backend query optimization when datasets grow

Feedback Reference:


1. The Issue & Standard Requirement​

Currently, only a few tables under the CMS group (Articles, Events, Banners) display row indices (STT) and footer pagination controls.

Most other system management tables under other sections lack these controls:

  • Booking Group: Booking List (Danh sΓ‘ch booking), Spa Services (Dα»‹ch vα»₯ spa)
  • Minigame Group: Spin History (Lα»‹ch sα»­ quay)
  • Voucher Group: Vouchers list, Voucher Redemptions
  • Membership Group: Membership tiers list, Point transfers

Standard Requirement:​

Every data table in the Admin CMS must implement:

  1. An Index Column (STT) as the very first column.
  2. A Pagination Footer supporting page index controls and total item count labels.

2. Table Layout Standard Specification​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ [πŸ” Search...] [+ Add Item] β”‚
β”œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ STT β”‚ Main Identifier β”‚ Attribute 1 β”‚ Attribute 2 β”‚ Actionsβ”‚
β”œβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 1 β”‚ Item Name A β”‚ Value 1 β”‚ Value 2 β”‚ ✏️ πŸ—‘ β”‚
β”‚ 2 β”‚ Item Name B β”‚ Value 1 β”‚ Value 2 β”‚ ✏️ πŸ—‘ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Hiển thα»‹ 1–10 / 48 kαΊΏt quαΊ£ [TrΖ°α»›c] [1] [2] [Sau] β”‚ ← Standard Footer
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. Implementation Details​

3.1 First Column: STT (Row Index) Calculation​

The row index should account for the current page number to prevent index resets when changing pages:

// Index calculator formula
const getRowIndex = (indexInCurrentPage: number, currentPage: number, pageSize: number): number => {
return (currentPage - 1) * pageSize + indexInCurrentPage + 1;
};

The footer component must be rendered right below the table boundary and contain:

  • Left Label: "Hiển thα»‹ [Start]–[End] / [Total] kαΊΏt quαΊ£"
    • Start = (currentPage - 1) * pageSize + 1
    • End = Math.min(currentPage * pageSize, totalItems)
  • Right Page Buttons:
    • [TrΖ°α»›c] (Previous) button: disabled if currentPage === 1.
    • Numbered page pills: e.g., [1], [2], [3] (active page highlighted in brand color).
    • [Sau] (Next) button: disabled if currentPage === totalPages.

4. API Pagination Requirements (Backend Integration)​

All backend fetch endpoints for lists must support offset-based pagination query parameters:

// GET /api/cms/services?page=2&pageSize=10
interface PaginatedResponse<T> {
items: T[];
totalCount: number;
totalPages: number;
currentPage: number;
pageSize: number;
}

5. Affected Screens Audit List​

Ensure the following screens are updated to comply with this layout standard:

Section / MenuView File / ComponentRequired Actions
Booking > Booking ListBookingListTable.tsxAdd STT column & Pagination footer
Booking > Spa ServicesSpaServicesListTable.tsxAdd STT column & Pagination footer
Minigame > Spin HistorySpinHistoryTable.tsxAdd STT column & Pagination footer
Voucher > VouchersVouchersTable.tsxAdd STT column & Pagination footer
Voucher > RedemptionsVoucherRedemptionsTable.tsxAdd STT column & Pagination footer
Membership > TiersMembershipTiersTable.tsxAdd STT column (Pagination optional if total tiers <= 10)
Point transfersPointTransfersTable.tsxAdd STT column & Pagination footer

Technical Checklist​

  • Build a reusable <TablePaginationFooter /> component in the CMS theme library.
  • Update the global list container layout template to always append the pagination footer.
  • Go through the affected screens audit list one-by-one.
  • Add the STT header block and render index calculations in the first cell of the rows.
  • Connect the onChangePage callback from the footer to trigger API calls with updated page offsets.
  • Verify sorting: ensure changing sort fields does not reset page indexes incorrectly.
  • Run build validation to ensure consistent layout compile targets.