From 4ae8e26749bc94a5c700f123cfeae209151411d8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 8 Jul 2024 21:19:09 +0800 Subject: [PATCH] bugfix --- bricks/css/bricks.css | 7 +++-- bricks/datarow.js | 3 +- bricks/dataviewer.js | 48 +++++++++++++++++++------------- bricks/form.js | 29 +++++++++---------- bricks/input.js | 6 ++++ bricks/llm.js | 25 ++++------------- bricks/tabular.js | 65 +++++++++++++++++++++++++++++++++++++------ bricks/utils.js | 9 ++++++ 8 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bricks/css/bricks.css b/bricks/css/bricks.css index 855f137..3a05ab1 100755 --- a/bricks/css/bricks.css +++ b/bricks/css/bricks.css @@ -299,29 +299,30 @@ body { overflow: auto; } .tabular-header-row { + background-color: #dddddd; display: table-header-group; position: sticky; top: 0; width: auto; } .tabular-row { - border: 1px solid #ccc; width: auto; margin-bottom: 5px; } .tabular-row:nth-child(odd) { - background-color: #fdfdfd; + background-color: #5dfdfd; } .tabular-row:nth-child(even) { background-color: #f9f9f9; } .tabular-row-selected { - background-color: #efefef; + background-color: #ef0000; } .tabular-row-content { padding: 10px; } .tabular-cell { + border: 1px solid #ccc; text-overflow: ellipsis; } diff --git a/bricks/datarow.js b/bricks/datarow.js index 1535c4c..b9470a2 100644 --- a/bricks/datarow.js +++ b/bricks/datarow.js @@ -20,15 +20,14 @@ bricks.DataRow = class extends bricks.HBox { */ constructor(opts){ super(opts); + this.set_style('width', 'auto'); this.record_w = null; } render_header(){ this.render(true); - this.set_css('tabular-header-row'); } render_data(){ this.render(false); - this.set_css('tabular-row'); } render(header){ this.build_toolbar(header); diff --git a/bricks/dataviewer.js b/bricks/dataviewer.js index 76a3138..ca9150e 100644 --- a/bricks/dataviewer.js +++ b/bricks/dataviewer.js @@ -13,8 +13,10 @@ bricks.DataViewer = class extends bricks.VBox { cache_pages:this.opts.cache_limit }); this.old_params = null; + this.select_row = null; this.active_item = null; this.loading = false; + this.data_offset = 0; this.bind('row_check_changed', this.show_check_event_data.bind(this)); schedule_once(this.build_all.bind(this), 0.1); } @@ -71,28 +73,30 @@ bricks.DataViewer = class extends bricks.VBox { this.filler_widget.add_widget(this.scrollpanel); } async renderPageData(data, page){ + var pos; + if (! this.loader.is_max_page(page)){ + data.reverse(); + pos = this.data_offset; + } else { + pos = null; + } + for(var i=0; i