MembersListPreview
Introduction
Members List Preview
widget simply displays a list of members. It can be used to display members that were selected by the user in the Members List Selector widget for example.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Supervisely |
|
| Max width of the widget |
|
| Text that will be displayed when there are no members in widget |
|
| ID of the widget |
users
List of UserInfo
objects.
type: List[UserInfo]
max_width
Set the maximum width of the widget in pixels.
type: int
default 300
empty_text
Text that will be displayed when there are no members in the widget.
type: str
default None
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Set users to the widget. |
Mini App Example
In this example we will create a mini app with MembersListPreview
widget. We will create a MembersListSelector
widget and display selected members with MembersListPreview
widget.
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/media/019_members_list_preview/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Define team ID
Get Team members and initialize MembersListSelector
widget
MembersListSelector
widgetInitialize MembersListPreview
widget and Text
widget for displaying number of selected members
MembersListPreview
widget and Text
widget for displaying number of selected membersCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widgets that we've previously created into the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add functions to control widgets from python code
Last updated