Skip to content

Commit 84a938f

Browse files
committed
improve table search and sort
this reimplements table searching and sorting from scratch inside sqlpage instead of using the (unmaintained and buggy) list.js library this makes the sqlpage js smaller and faster to load this improves table filtering speed this fixes incorrect sorting when using markdown links fixes #576
1 parent 98afe59 commit 84a938f

File tree

3 files changed

+184
-154
lines changed

3 files changed

+184
-154
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
- **server-sent events** : the component can now be used to stream query results to the client in real-time using server-sent events.
1515
- The [csv](https://sql.datapage.app/component.sql?component=csv) component can now be used as a header component to trigger a download of the CSV file directly on page load. Just select the `csv` as a component without a shell before it, and the CSV will be efficiently streamed to the user''s browser. This finally allows efficiently serving large datasets as CSV.
1616
- In the shell component, the site title is no longer wrapped in a `<h1>` tag, which should help search engines better understand the content of the page, and potentially improve SEO.
17+
- Improve table search and sort:
18+
- sorting and searching should now be faster on large tables. Searching (filtering) is now especially fast, and should not take more than a few milliseconds even on tables with thousands of rows.
19+
- sorting should now work correctly on markdown columns. Markdown links used to be sorted according to the link URL, which was not intuitive. Now, only the displayed text is used for sorting.
1720

1821
## 0.29.0 (2024-09-25)
1922
- New columns component: `columns`. Useful to display a comparison between items, or large key figures to an user.

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ INSERT INTO example(component, description, properties) VALUES
708708
'{"Forename": "Ophir", "Surname": "Lojkine", "Pseudonym": "lovasoa"},' ||
709709
'{"Forename": "Linus", "Surname": "Torvalds", "Pseudonym": "torvalds"}]')),
710710
('table', 'A table that uses markdown to display links',
711-
json('[{"component":"table", "markdown": "Documentation", "icon": "icon", "sort": true, "search": true}, '||
712-
'{"icon": "table", "name": "Table", "description": "Displays SQL results as a searchable table.", "Documentation": "[docs](documentation.sql?component=table)", "_sqlpage_color": "red"},
713-
{"icon": "timeline", "name": "Chart", "description": "Show graphs based on numeric data.", "Documentation": "[docs](documentation.sql?component=chart)"}
711+
json('[{"component":"table", "markdown": "Name", "icon": "icon", "sort": true, "search": true}, '||
712+
'{"icon": "table", "name": "[Table](?component=table)", "description": "Displays SQL results as a searchable table.", "_sqlpage_color": "red"},
713+
{"icon": "timeline", "name": "[Chart](?component=chart)", "description": "Show graphs based on numeric data."}
714714
]')),
715715
(
716716
'table',

0 commit comments

Comments
 (0)