I am trying to replicate a nested table in the cook book using my local data,but it triggered an exception capture in init.py line 348:
` except components.components.MarshallComponentException as ex:
uses a more complete error message.
args = list(ex.args)
args[0] += ". If you're using custom JsCode objects on gridOptions, ensure that allow_unsafe_jscode is True."
ex = components.components.MarshallComponentException(*args)
raise(ex)`
And the compiler prompted me strangely:
module 'streamlit.components.v1' has no attribute 'components'
(I dont have this when I tried to run the offical demo.)
Therefore, it's difficult for me to find out bugs. Please tell me if I did something wrong, thank you!
Here is my code and data:
gridOptions = {
# enable Master / Detail
"masterDetail": True,
"rowSelection": "single",
# the first Column is configured to use agGroupCellRenderer
"columnDefs": [
{
"field": "单号",
"cellRenderer": "agGroupCellRenderer",
"checkboxSelection": True,
},
{"field": "销售日期"},
{"field": "售出时间"},
{"field": "营业员id"},
{"field": "总金额"},
],
"defaultColDef": {
"flex": 1,
},
# provide Detail Cell Renderer Params
"detailCellRendererParams": {
# provide the Grid Options to use on the Detail Grid
"detailGridOptions": {
"rowSelection": "multiple",
"suppressRowClickSelection": True,
"enableRangeSelection": True,
"pagination": True,
"paginationAutoPageSize": True,
"columnDefs": [
{"field": "明细编号", "checkboxSelection": True},
{"field": "图书编号"},
{"field": "书名"},
{"field": "标价"},
{"field": "折扣"},
{"field": "折后价格"},
{"field": "数量"},
{"field": "单项总价"},
],
"defaultColDef": {
"sortable": True,
"flex": 1,
},
},
"getDetailRowData": JsCode(
"""function (params) {
params.successCallback(params.data.details_list);
}"""
),
},
"rowData": data
}
r = AgGrid(
None,
gridOptions=gridOptions,
enable_enterprise_modules=True,
# update_mode=GridUpdateMode.SELECTION_CHANGED,
key="an_unique_key",
)
I am trying to replicate a nested table in the cook book using my local data,but it triggered an exception capture in init.py line 348:
` except components.components.MarshallComponentException as ex:
uses a more complete error message.
And the compiler prompted me strangely:
(I dont have this when I tried to run the offical demo.) Therefore, it's difficult for me to find out bugs. Please tell me if I did something wrong, thank you!
Here is my code and data:
my local data: