Forum Discussion

CDavidOrr's avatar
CDavidOrr
Cloud Apps
12-15-2021
Solved

Use of Conditions in BloX

I am attempting to use Conditions in a BloX widget.  Unfortunately, the documentation for this feature is not very thorough and doesn't cover my use case. I am building a table.  Each row has two c...
  • harikm007's avatar
    12-16-2021

    Hi CDavidOrr ,

    You can use javascript in Blox (inside <script> tag). For example see line 4 and 5 below.

     

     "columns": [
                            {
                                "type": "TextBlock",
                                "class": "Count2017",
                                "text": "2️0️1️7️<script>if({panel:Count2017}<0){$('.Count2017').parent().hide()} </script>",
                                "horizontalAlignment": "center",
                                "style": {
                                    "width": "75px",
                                    "border-top": "solid",
                                    "border-bottom": "solid",
                                    "border-left": "solid",
                                    "border-right": "solid",
                                    "border-width": "2px"
                                }
                            },
                            {
                                "type": "TextBlock",
                                "text": "{panel:count2017}",
                                "horizontalAlignment": "center",
                                "style": {
                                    "width": "175px",
                                    "border-top": "solid",
                                    "border-bottom": "solid",
                                    "border-left": "solid",
                                    "border-right": "solid",
                                    "border-width": "2px"
                                }
                            }
                        ]