From 65ece3e01e66e5231ae933b9d01a5e55b482ed16 Mon Sep 17 00:00:00 2001 From: Robin Brisa Date: Wed, 10 Aug 2022 17:58:02 +0200 Subject: [PATCH] [Form] Example of customizing EnumType labels Default behavior when creating a EnumType form element is that the choice labels displayed to the user are the enum names. This PR adds an example of how to use a function inside an enum to return labels and how to bind this function to the form element. --- reference/forms/types/enum.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/reference/forms/types/enum.rst b/reference/forms/types/enum.rst index b2e960a21ec..4c9d3eeb8a5 100644 --- a/reference/forms/types/enum.rst +++ b/reference/forms/types/enum.rst @@ -56,6 +56,40 @@ This will display a ```` or ````. +Since the label displayed in the ``