I have a list with layout set to Gallery. The list has Title, URL and recently added a Display field. Currently clickable tiles are displayed and I now want these tiles to turn grey (disabled) when the list item column 'Display' is set to 1. (Prefer to use a boolean, but this didnt work either) The tiles part work and so does hovering over. However I cannot manage to disable. Here is the code before I tried adding the disable condition:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
"hideSelection": true,
"width": "120",
"height": "100",
"formatter": {
"elmType": "a",
"attributes": {
"href": "[$URL]",
"target": "=if([$NewTab] == true, '_blank', '')"
},
"style": {
"text-decoration": "none"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "ms-bgColor-themeLighterAlt ms-bgColor-themePrimary--hover ms-fontColor-white--hover ms-fontColor-gray150"
},
"style": {
"display": "flex",
"flex-wrap": "wrap",
"min-width": "120px",
"min-height": "100px",
"margin-right": "10px",
"margin-top": "10px",
"box-shadow": "2px 2px 4px darkgrey"
},
"children": [
{
"elmType": "div",
"style": {
"text-align": "center",
"margin": "auto"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "sp-row-title "
},
"style": {
"font-size": "12px"
},
"txtContent": "[$Title]"
},
{
"elmType": "div",
"attributes": {
"iconName": "[$Icon]",
"class": "ms-fontSize-su"
}
}
]
}
]
}
]
}
}
I tried changing the class attibutes to :
"attributes": {
"class": "=if([$Display] == '1', 'ms-bgColor-themeLighterAlt', '')"
},
But the styling disapears and conditional statement dooes not work. Any thoughts on the issue please?
