githubEdit

ReorderTable

Introduction

ReorderTable widget in Supervisely displays tabular data and allows users to reorder rows with drag-and-drop.

It supports multi-row selection and provides quick actions in a floating panel (Top, Up, Set to #, Down, Bottom) to move selected rows.

Read this tutorial in developer portal.arrow-up-right

Function signature

ReorderTable(
    columns: List[str],
    data: Optional[List] = None,
    page_size: int = 10,
    content_top_right: Optional[Widget] = None,
    widget_id: Optional[str] = None,
)

Parameters

Parameters
Type
Description

columns

List[str]

Table columns names.

data

Optional[List]

Table rows, where each row is a list of cell values by column.

page_size

int

Number of rows per page.

content_top_right

Optional[Widget]

Optional widget rendered in the top-right area of the table header.

widget_id

Optional[str]

ID of the widget.

Methods and attributes

Attributes and Methods
Description

get_order()

Get current rows order as list of 0-based indices from the original data.

get_reordered_data()

Get table rows in the current user-defined order.

get_column_data(column_name: str)

Get values from one column in the current row order.

set_data(columns: List, data: List)

Replace table data and reset order.

reset_order()

Reset current order to the original identity order.

is_order_changed()

Check whether current order differs from the original order.

@order_changed

Decorator callback fired whenever row order changes in the UI.

Mini App Example

You can find this example in our Github repository:

ui-widgets-demos/tables/008_reorder_table/src/main.pyarrow-up-right

Import libraries

Initialize widget

Create app layout

Add callbacks

Last updated