0

There is server-part code from example on https://shinylive.io/py/examples/#data-frame-grid, but a bit simplified.

    @output
    @render.data_frame
    def grid():
        return render.DataGrid(
                penguins,
                row_selection_mode='multiple',
                height=350,
                width="100%",
                filters=True,
            )

    @output
    @render.text
    def detail():
        if (
            input.grid_selected_rows() is not None
            and len(input.grid_selected_rows()) > 0
        ):
            # "split", "records", "index", "columns", "values", "table"
            return penguins.iloc[list(input.grid_selected_rows())]

to show values from selected rows.

But how to reset selection? Only re-render datagrid?

Jan
  • 2,245
  • 1
  • 2
  • 16
anon.for
  • 57
  • 5

0 Answers0