persistence does not work when editing cell
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với tài liệu về persistence được liên kết trong issue và chạy mẫu editable-grid đầu tiên bằng persisted_props=['rowData']. So sánh hành vi của nó với workaround dcc.Store, sau đó theo dõi cách component xử lý persistence. Được xem là hoàn tất khi các giá trị ô đã chỉnh sửa vẫn còn khả dụng sau lần persistence reload liên quan mà không cần workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Based on the Docs:. We would like to make the data persist after editing the table. The persisted_props might be rowData. However, the persistence does not work as in the sample below:
"""
Accessing Row Data in an editable grid
"""
import dash
import dash_ag_grid as dag
from dash import Dash, html, dcc, Input, Output, State,ctx
import plotly.express as px
import pandas as pd
import json
app = Dash(__name__)
df = px.data.medals_wide()
app.layout = html.Div(
[
dcc.Markdown(id= 'dummy-input', children="Example of using `rowData` in a callback with an editable grid and added persistence to cell"),
dag.AgGrid(
id="editing-grid",
columnDefs=[{"field": i} for i in df.columns],
rowData=df.to_dict("records"),
columnSize="sizeToFit",
defaultColDef={"editable": True},
persistence=True,
persisted_props=['rowData'],
),
],
style={"margin": 20},
)
if __name__ == "__main__":
app.run_server(debug=True)
A workaround is to use dcc.Store() as below:
"""
Accessing Row Data in an editable grid
"""
import dash
import dash_ag_grid as dag
from dash import Dash, html, dcc, Input, Output, State,ctx
import plotly.express as px
import pandas as pd
import json
app = Dash(__name__)
df = px.data.medals_wide()
app.layout = html.Div(
[
dcc.Markdown(id= 'dummy-input', children="Example of using `rowData` in a callback with an editable grid and added persistence to cell"),
dag.AgGrid(
id="editing-grid",
columnDefs=[{"field": i} for i in df.columns],
rowData=df.to_dict("records"),
columnSize="sizeToFit",
defaultColDef={"editable": True},
),
dcc.Store(id='memory',storage_type = 'session'),
html.Div(id="editing-grid-output2"),
],
style={"margin": 20},
)
@app.callback(
Output("memory", "data"),
Output("editing-grid", "rowData"),
Input("editing-grid", "cellValueChanged"),
State("editing-grid", "rowData"),
State("memory", "data"),
)
def update(cell,rows,saved_rows):
if saved_rows is None:
saved_rows = df.to_dict("records")
if cell is None:
return saved_rows, saved_rows
else:
return rows,rows
if __name__ == "__main__":
app.run_server(debug=True)
- 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 111 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ự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs documentation effort:M ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mczielinski/ob-analytics#423 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
infra
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/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
Maintainer thường phản hồi trong vòng 3 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
vllm-project/vllm-ascend#21033 ·
Maintainer thường phản hồi trong vòng 1 ngày