From c826675caaf7a7094d46f62d6d21c35603d51149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Fri, 13 Jan 2023 12:16:38 +0100 Subject: [PATCH] [UPD] web_tree_dynamic_colored_field: readme usage section --- web_tree_dynamic_colored_field/README.rst | 14 +++++++++++++- web_tree_dynamic_colored_field/readme/USAGE.rst | 14 +++++++++++++- .../static/description/index.html | 17 ++++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/web_tree_dynamic_colored_field/README.rst b/web_tree_dynamic_colored_field/README.rst index 90abc69ed..18eecc0c9 100644 --- a/web_tree_dynamic_colored_field/README.rst +++ b/web_tree_dynamic_colored_field/README.rst @@ -114,7 +114,19 @@ Example: overrides the rest of `colors` attributes, and that you need the tree to load your field in the first place by adding it as invisible field. -**Note that you should always use single quotes for fields' ``options`` and wrap nested values in double quotes since ``options`` is a JSON object.** +* Can use strings too... In the tree view declaration, put ``options="{'fg_color': 'green:customer_state == \'success\''}"`` attribute in the ``field`` tag:: + + ... + + + ... + + ... + + + ... + +**Note that you can use single or normal quotes. If the declaration of the options doesn't follow the JSON format, the options string will be evaluated using py.eval()** Known issues / Roadmap ====================== diff --git a/web_tree_dynamic_colored_field/readme/USAGE.rst b/web_tree_dynamic_colored_field/readme/USAGE.rst index 251009474..92754f145 100644 --- a/web_tree_dynamic_colored_field/readme/USAGE.rst +++ b/web_tree_dynamic_colored_field/readme/USAGE.rst @@ -67,4 +67,16 @@ Example: overrides the rest of `colors` attributes, and that you need the tree to load your field in the first place by adding it as invisible field. -**Note that you should always use single quotes for fields' ``options`` and wrap nested values in double quotes since ``options`` is a JSON object.** +* Can use strings too... In the tree view declaration, put ``options="{'fg_color': 'green:customer_state == \'success\''}"`` attribute in the ``field`` tag:: + + ... + + + ... + + ... + + + ... + +**Note that you can use single or normal quotes. If the declaration of the options doesn't follow the JSON format, the options string will be evaluated using py.eval()** diff --git a/web_tree_dynamic_colored_field/static/description/index.html b/web_tree_dynamic_colored_field/static/description/index.html index ae3e4ca4e..7426a425a 100644 --- a/web_tree_dynamic_colored_field/static/description/index.html +++ b/web_tree_dynamic_colored_field/static/description/index.html @@ -453,7 +453,22 @@ options='{"fg_color": "red:red_color == True; green:green_color = overrides the rest of `colors` attributes, and that you need the tree to load your field in the first place by adding it as invisible field. -

Note that you should always use single quotes for fields’ ``options`` and wrap nested values in double quotes since ``options`` is a JSON object.

+ +

Note that you can use single or normal quotes. If the declaration of the options doesn’t follow the JSON format, the options string will be evaluated using py.eval()

Known issues / Roadmap