This commit is contained in:
yumoqing 2024-10-31 18:34:08 +08:00
parent 4231628a4a
commit 24cf16147d
2 changed files with 11 additions and 5 deletions

View File

@ -356,16 +356,22 @@ body {
overflow: auto; overflow: auto;
} }
.tabular-header-row { .tabular-header-row {
background-color: #dddddd; display: flex;
position: sticky;
top: 0; top: 0;
position: sticky;
background-color: #dddddd;
min-width: 0;
min-width: fit-content;
flex-wrap: nowrap; flex-wrap: nowrap;
flex-shrink: 0; flex-shrink: 0;
} }
.tabular-row { .tabular-row {
display: flex;
margin-bottom: 5px;
min-width: 0;
min-width: fit-content;
flex-wrap: nowrap; flex-wrap: nowrap;
flex-shrink: 0; flex-shrink: 0;
margin-bottom: 5px;
} }
.tabular-row:nth-child(odd) { .tabular-row:nth-child(odd) {
background-color: #5dfdfd; background-color: #5dfdfd;
@ -374,7 +380,7 @@ body {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.tabular-row-selected { .tabular-row-selected {
background-color: #ef0000; color: #ef0000;
} }
.tabular-row-content { .tabular-row-content {
padding: 2; padding: 2;

View File

@ -26,7 +26,6 @@ bricks.Tabular = class extends bricks.DataViewer {
return r; return r;
} }
var row = new bricks.VBox({ var row = new bricks.VBox({
css:'tabular-row'
}); });
row.add_widget(r); row.add_widget(r);
var content = new bricks.VBox({ var content = new bricks.VBox({
@ -97,6 +96,7 @@ bricks.Tabular = class extends bricks.DataViewer {
header = false; header = false;
} }
var dr = new bricks.DataRow(options); var dr = new bricks.DataRow(options);
dr.set_css('tabular-row');
dr.render(header); dr.render(header);
dr.event_names.forEach(e => { dr.event_names.forEach(e => {
dr.toolbar_w.bind(e, this.record_event_handle.bind(this, e, record, dr)); dr.toolbar_w.bind(e, this.record_event_handle.bind(this, e, record, dr));