Skip to content

Commit f46ccf5

Browse files
committed
add _sqlite_id to the table component
closes #538 (reply in thread)
1 parent b3c8d69 commit f46ccf5

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Fixed multiple small display issues in the chart component.
1818
- Better error handling: Stop processing the SQL file after the first error is encountered.
1919
- The previous behavior was to try paresing a new statement after a syntax error, leading to a cascade of irrelevant error messages after a syntax error.
20+
- Allow giving an id to HTML rows in the table component. This allows making links to specific rows in the table using anchor links. (`my-table.sql#myid`)
2021

2122
## 0.26.0 (2024-08-06)
2223
### Components

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,8 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
691691
('empty_description', 'Text to display if the table does not contain any row. Defaults to "no data".', 'TEXT', TRUE, TRUE),
692692
-- row level
693693
('_sqlpage_css_class', 'For advanced users. Sets a css class on the table row. Added in v0.8.0.', 'TEXT', FALSE, TRUE),
694-
('_sqlpage_color', 'Sets the background color of the row. Added in v0.8.0.', 'TEXT', FALSE, TRUE)
694+
('_sqlpage_color', 'Sets the background color of the row. Added in v0.8.0.', 'TEXT', FALSE, TRUE),
695+
('_sqlpage_id', 'Sets the id of the html tabler row element. Allows you to make links targeting a specific row in a table.', 'TEXT', FALSE, TRUE)
695696
) x;
696697

697698
INSERT INTO example(component, description, properties) VALUES

sqlpage/templates/table.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<tbody class="table-tbody list">{{#delay}}</tbody>{{/delay}}
3535
{{/if}}
3636

37-
<tr class="{{_sqlpage_css_class}} {{#if _sqlpage_color}}bg-{{_sqlpage_color}}-lt{{/if}}">
37+
<tr class="{{_sqlpage_css_class}} {{#if _sqlpage_color}}bg-{{_sqlpage_color}}-lt{{/if}}" {{#if _sqlpage_id}}id="{{_sqlpage_id}}"{{/if}}>
3838
{{~#each this~}}
3939
{{~#if (not (starts_with @key '_sqlpage_'))~}}
4040
<td class="

0 commit comments

Comments
 (0)