Column widths incorrectly calculated based on previous rowData when using autoSize in AgGrid
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, python
Hướng nghiên cứu
Bắt đầu với bản tái hiện Dash và AgGrid được cung cấp, sau đó theo dõi DashAgGrid.updateColumnWidths() và lệnh gọi gridApi.autoSizeAllColumns(skipHeader) bên trong trong quá trình cập nhật bộ lọc. Hoàn thành nghĩa là độ rộng cột được tính từ rowData mới nhất thay vì dữ liệu đã lọc trước đó, và bản tái hiện không còn hiển thị việc định kích thước cũ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
I'm using AgGrid component with columnSize="autoSize" configuration.
When the data filter value is changed, the grid column widths are calculated based on the previous instead on the latest rowData.
It seems like the DashAgGrid.updateColumnWidths() (and the inner gridApi.autoSizeAllColumns(skipHeader)) are called before the most recent rowData is set.
Expected behavior would be that the column widths are always aligned with the latest rowData.
How to Reproduce
Package version: dash-ag-grid==31.2.0
After running the code below, adjust the range slide filter as it's showed in the screen recoding (video below the code section):
import dash
from dash import dcc, html, Input, Output, callback
import dash_ag_grid as dag
import pandas as pd
# Initialize the Dash app
app = dash.Dash(__name__)
# Sample data
df = pd.DataFrame({
'Column 1': [1, 2, 3, 4, 5, 6],
'Column 2': ['A', 'B', 'C', 'VeryLongStringInputCell_VeryLongStringInputCell_VeryLongStringInputCell', 'D', 'E'],
'Column 3': [10.5, 20.1, 30.2, 40.3, 50.4, 60.5],
})
# Layout
app.layout = html.Div([
html.H1('Grid Page'),
html.Div(id="outer_div_grid_id"),
dcc.RangeSlider(id="filter_column_1_dropdown", min=1, max=6, step=1, value=[1, 6]),
])
@callback(
Output("outer_div_grid_id", "children"),
Input("filter_column_1_dropdown", "value"),
)
def update_outer_grid(dropdown_value):
df_filtered = df[df["Column 1"].between(dropdown_value[0], dropdown_value[1], inclusive="both")]
return [dag.AgGrid(
id='grid_id',
columnDefs=[{'field': col} for col in df.columns],
columnSize="autoSize",
rowData=df_filtered.to_dict('records'),
defaultColDef={'resizable': True},
)]
if __name__ == "__main__":
app.run_server(debug=True, port=8051)
https://github.com/user-attachments/assets/ffa449c4-4219-42ef-bf0e-a152449b0c58
- Ngôn ngữ chính
- Python
- Star
- 239
- Fork
- 48
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/dash-ag-grid
-
Sparklines always use AG Charts Enterprise, so a Grid-only Enterprise license shows a watermarkĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
plotly/dash-ag-grid#485 · 1 bình luận ·
-
Legacy themes don't work offlineĐang mởdocumentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
plotly/dash-ag-grid#484 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
plotly/dash-ag-grid#483 ·
-
Bump to v36Có thể đã có người làm @BSd3v đã nhận 112 ngày trước. Đang mở
plotly/dash-ag-grid#481 · 1 reaction · 2 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
plotly/dash-ag-grid#474 · 1 bình luận ·
Tất cả issue của plotly/dash-ag-grid
Issue tương tự
-
follow-up needs-triage S3: minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
manaflow-ai/cmux#36856 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Shell framework build fails at "copy the shader libraries": the iOS shader libraries are now one file b-<chain>.imgCó thể đã có người làm @xiaofeng-han đã nhận hôm nay. Đang mởbuild ios
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày