Skip to content

Instantly share code, notes, and snippets.

@hatenablogtest
Created December 26, 2020 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatenablogtest/0c31250fb2c78d814fbba76f1cdab0cf to your computer and use it in GitHub Desktop.
Save hatenablogtest/0c31250fb2c78d814fbba76f1cdab0cf to your computer and use it in GitHub Desktop.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"customRowAction": {
"action": "defaultClick"
},
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontSize-m"
},
"style": {
"border": "none",
"background-color": "transparent"
},
"children": [
{
"elmType": "span",
"style": {
"display": "=if([$_CommentCount] == '' , 'none' , 'block')"
},
"attributes": {
"iconName": "Comment"
}
},
{
"elmType": "span",
"txtContent": "=if([$_CommentCount] == '' , '0' , [$_CommentCount])",
"style": {
"margin-left": "10px"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment