Python side code:
@dataclass(frozen=True)
RowId:
key_part1: str
key_part2: str
@dataclass
Row:
id: RowId
data: str
spec = {
'columnDefs': [
{'headerName': 'id', 'field': 'id' },
{'headerName': 'data', 'field': 'data'}
],
'rowData': [
Row(RowId('a', 'b'), 'c')
]
}
ui.aggrid(spec)
Results in the following value rendered for the id
field in the browser:
[object Object]
Also browser console has a warning suggesting to provide a custom formatter for data type object
(how do I do it?).
Can it be improved?
see the product example in https://github.com/zauberzeug/nicegui/discussions/2028
The key idea is to have an as_html:
and a special list of dicts to load in the ag_grid:
The source code is at https://github.com/WolfgangFahl/scan2wiki/blob/main/scan/product.py and https://github.com/WolfgangFahl/scan2wiki/blob/main/scan/webcam.py
where you'll find the loading of the ag_grid