| name | gridlite-pagination-search |
| description | GridLite pagination and global search: page size options, programmatic page control, global search setup. Use when configuring pagination or search. |
| user-invocable | true |
GridLite Pagination & Search
Pagination
Enable (On by Default)
<GridLite
features={{ pagination: true }}
config={{
id: 'grid',
pagination: {
pageSize: 25,
pageSizeOptions: [10, 25, 50, 100]
}
}}
/>
Disable Pagination
<GridLite features={{ pagination: false }} />
Programmatic Page Control
grid.setPage(0);
grid.setPage(5);
grid.setPageSize(50);
SQL Implementation
SELECT * FROM employees ORDER BY "id" LIMIT 25 OFFSET 25
SELECT COUNT(*) AS total FROM employees
Pagination with Grouping
When grouping is active, pagination applies to group count, not row count:
- "Page 1 of 3 (50 groups)" instead of "Page 1 of 10 (250 rows)"
Global Search
Enable
<GridLite features={{ globalSearch: true }} />
Behaviour
- Search input appears in the toolbar
- 300ms debounce on input
- Searches across all text columns using
ILIKE
- Resets to page 0 on search
- Clear button appears when search is active
Programmatic Search
grid.setGlobalFilter('engineering');
grid.setGlobalFilter('');
SQL Implementation
WHERE ("name" ILIKE '%' || $1 || '%'
OR "email" ILIKE '%' || $1 || '%'
OR "department" ILIKE '%' || $1 || '%')
Combined with Filters
Global search combines with FilterBar conditions using AND:
WHERE ("department" = $1)
AND ("name" ILIKE '%' || $2 || '%'
OR "email" ILIKE '%' || $2 || '%')