Hide a view
New in v14.22.0
A view can be hidden (or shown) based on other input fields by assigning a callback function to the visible
argument
within the view. The callback function needs to return a boolean:
def get_visibility(params, **kwargs):
return params.param_x
class Controller(vkt.Controller):
...
@vkt.TableView("Results", visible=get_visibility)
def my_table_view(self, params, **kwargs):
...
If a Page
or Step
is used, views
will only be visible in the editor if they are both visible and defined in the page/step's views
.
When the visibility depends on data of another entity, the entity_id
can be used to navigate and obtain data using
the SDK API.
tip
Upon evaluation of the visibility constraint, the platform passes the params
, entity_id
, entity_name
, and
workspace_id
to the callback function. All individual kwargs
can be added explicitly in the signature if desired:
def get_visibility(params, entity_id, entity_name, workspace_id, **kwargs):
...