job_selector
Select jobs from the list of all job entities.
The job selector shows all the job entities handled by Taipy and lets the user select a job or a set of jobs from the list.
Properties¶
Name | Type | Default | Description |
---|---|---|---|
(★) |
Job|list[Job] dynamic |
Bound to the selected s, or None if there is none. |
|
show_id |
bool |
True | If False, the |
show_submitted_label |
bool |
True | If False, the |
show_submitted_id |
bool |
False | If True, the |
show_submission_id |
bool |
False | If True, the submission id is shown in the selector. |
show_date |
bool |
True | If False, the |
show_cancel |
bool |
True | If False, the Cancel buttons are not shown in the selector. |
show_delete |
bool |
True | If False, the Delete buttons are not shown in the selector. |
on_change |
Union[str, Callable] |
A function or the name of a function that is triggered when the selection is updated. |
|
height |
str |
"50vh" | The maximum height, in CSS units, of the control. |
on_details |
Union[str, Callback, bool] |
The name of a function that is triggered when the details icon is pressed.
|
|
id |
str |
The identifier that will be assigned to the rendered HTML component. |
|
class_name |
str dynamic |
The list of CSS class names associated with the generated HTML Element. |
(★)value
is the default property for this visual element.
Details¶
The job_selector
control lists all jobs resulting from submissions of entities.
All jobs are represented as a row in a table with all the related details.
Here is an example of what the job selector control would look like with default settings after a few jobs were executed:
Selection
The user can select one or more jobs from the list. The variable bound to the value property is updated accordingly. A list of selected jobs is returned if several jobs were selected.
All jobs can be selected or deselected by switching the top-left check box to set or unset.
Actions
If the show_delete property is not set to False, a trash icon appears on the
right side of the row, for jobs that can be deleted (jobs that are not running). This allows for
removing the job from the list.
Similarly, if jobs that can be deleted are selected, and if the show_delete
property is set to True, a trash icon appears at the top-right corner of the control, to delete
all selected jobs from the list.
If the show_cancel property is not set to False, running jobs have a 'stop'
icon in their row, allowing to cancel them.
A similar icon appears at the top-right corner of the control when selected jobs can be canceled.
Filters
In the top left corner of the job selector control, there is a filter button that can be used to filter the displayed jobs depending on criteria that the user can specify:
When the user clicks that button, a filter dialog pops up where one can set different filters with different criteria:
Initially, this dialog has no configured filter, therefore the apply button indicates that '0' filters would be set.
To create a new filter, the user must select one of the control's columns, an operator (such as
is and is not), and an operand as a value.
In the following image, the user has indicated that only the jobs where the Status is set to
"ABANDONED" should be listed:
After the 'Add filter' button (with the '+' sign) is pressed, the filter is created:
The filter can be removed by pressing the trash icon to the right of the filter row.
Note that the 'Apply' button now indicates that there is a filter that can be applied.
Pressing the 'Apply' button applies the filter to the job selector list, resulting in the following image:
Note that next to the 'filter' button, the control now displays the number of currently applied filters.
Usage¶
Show or hide columns¶
The control's properties show_id, show_submitted_label, show_submitted_id, show_submission_id, show_date, show_cancel, and show_delete let you indicate what columns the job selector control displays.
We can define our control so the job identifiers and the submission dates are not shown, to have a more compact display:
Definition
<|{job}|job_selector|don't show_id|don't show_date|>
<taipy:job_selector show_id="false" show_date="false">{job}</taipy:job_selector>
import taipy.gui.builder as tgb
...
tgb.job_selector("{job}", show_id=False, show_date=False)
Here is what the control would look like: