Forum Discussion
Tyler_Borchardt
Jun 19, 2024Brass Contributor
Multiple lines of data in txtContent of custom hover card
I have a list that I am building a custom view for that will be displayed on a SharePoint page. I would like to create a hovercard that displays some of the item's properties like its title, descript...
- Jul 25, 2024
You need to create children DIV elements for each item you want to show in a separate line and use the "display" : "block"
style property in your parent DIV element that contains the child DIV elements.{ "elmType": "div", "style": { "font-size": "12px" }, "txtContent": "@currentField", "customCardProps": { "openOnEvent": "hover", "formatter": { "elmType": "div", "style": { "font-size": "14px", "color": "darkred", "padding": "8px", "display": "block" }, "children": [ { "elmType": "div", "txtContent": "='Tip: ' + [$TipTrickTitle]" }, { "elmType": "div", "txtContent": "='Link: ' + [$Linktokb]" } ] } } }
nhuawork
Jul 25, 2024Copper Contributor
You need to create children DIV elements for each item you want to show in a separate line and use the "display" : "block"
style property in your parent DIV element that contains the child DIV elements.
{
"elmType": "div",
"style": {
"font-size": "12px"
},
"txtContent": "@currentField",
"customCardProps": {
"openOnEvent": "hover",
"formatter": {
"elmType": "div",
"style": {
"font-size": "14px",
"color": "darkred",
"padding": "8px",
"display": "block"
},
"children": [
{
"elmType": "div",
"txtContent": "='Tip: ' + [$TipTrickTitle]"
},
{
"elmType": "div",
"txtContent": "='Link: ' + [$Linktokb]"
}
]
}
}
}