bpeikes
01-18-2023Cloud Apps
Blox dropdown?
Trying to follow the documentation on how to create a simple DropDown. I don't even want it dynamic (for now), but the documentation (https://docs.sisense.com/main/SisenseLinux/sisense-blox-reference...
In the responses to my earlier post about the Blox Dropdown, there is also a discussion of how to style a Dropdown widget. It turns out that in order to style the dropdown box itself, you need to include the "style" property at the top of the BLOX code in the widget.
For this to work, you *do* need the id set to 'selectVal'. Or tag the style with whatever other id you have set.
something like this, inspired by Alek_qbeeq
"style": "#selectVal { width: 100%; heigth: 10px; border: 1px solid; border-radius: 15px;}
This isn't true though. I have a concrete example, this works:
{
"type": "Input.ChoiceSet",
"displayType": "compact",
"backgroundColor": "#282c36",
"choices": [
{
"title": "(Any)",
"value": ""
},
{
"title": "Item1",
"value": "Item1"
},
{
"title": "Item2",
"value": "Item2"
}
]
}
And this renders as a set of radio buttons:
{
"type": "Input.ChoiceSet",
"id":"selectVal",
"backgroundColor": "#282c36",
"choices": [
{
"title": "(Any)",
"value": ""
},
{
"title": "Item1",
"value": "Item1"
},
{
"title": "Item2",
"value": "Item2"
}
]
}Oh, I get where I caused confusion. Apologies
I was only talking about adding/changing the formatting of the box that is there, and for that the 'id' attribute is required because the styling is set it.
However, to get the dropdown, you *do* need the 'displaytype:compact' attribute (and that very much needs to be documented). But to format the resulting box, you need the style formatting at the top of the blox code, with the snippet that *has* the displaytype:compact, also having the id that you specify at the top (in the example case, selectVal).
Good Luck!Iris
Yeah, the documentation is completely misleading. Spent several hours figuring out how to do a drop down. On top of that, the fact that sometimes attributes can be specified on the object, and sometimes on the style is completely frustrating.
It feels like the documentation was written by someone who doesn’t know how the product works.