The column
parameter is a way to match the component with the column described in the id
field of the columns
property of the DataGrid.
You can clone this app and see how I used it: DataGridJson - A DataGrid with quick simple setup
I wanted the headers to be clickable, so I removed the automatic header, added one pinned row, played with css to add the bottom border, played with the column and other properties, kept in mind that the pinned row is included in the count of visible rows on the current page, so I increase the number of rows per page by 1.
The columns
passed to the DataGridJson
custom component des not contain the required id
field. The custom component calls the _add_ids_to_columns
function to add an unique id to each column.
Then, when adding the header row in _create_headers
, it matches the header with each column with self.header_row.add_component(link, column=column['id'])
.