Closed chris883773 closed 2 years ago
Grüezi @chris883773,
Give a look and use your JSON, made small changes but should appear some content. Can you confirm the columns are included in the View that JSON can get the fields to display content?
updated json
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"debugMode": false,
"hideSelection": true,
"hideListHeader": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"style": {
"float": "left",
"margin": "10px",
"padding": "5px",
"min-width": "340px",
"border-radius": "15px"
},
"attributes": {
"class": "ms-bgColor-neutralLighterAlt ms-bgColor-neutralLight--hover ms-fontColor-themePrimary--hover"
},
"children": [
{
"elmType": "div",
"children": [
{
"elmType": "img",
"style": {
"display": "block",
"height": "auto",
"max-height": "120px",
"border-radius": "50%"
},
"attributes": {
"src": "='/_layouts/15/userphoto.aspx?size=S&username=' + [$Person.email]"
}
}
]
},
{
"elmType": "div",
"style": {
"text-align": "center",
"padding": "5px",
"margin": "auto",
"font-size": "1.1rem"
},
"children": [
{
"elmType": "div",
"style": {
"font-weight": "500",
"font-size": "1.5rem",
"margin-bottom": "0.5rem"
},
"txtContent": "=[$chLastName]+', '+[$chFirstName]"
},
{
"elmType": "div",
"txtContent": "[$chCompany]"
},
{
"elmType": "span",
"style": {
"font-weight": "500",
"font-size": "1.1em",
"overflow": "hidden",
"max-width": "280px",
"white-space": "nowrap"
},
"txtContent": "[$chJobTitle]"
},
{
"elmType": "div",
"txtContent": "[$chBusinessPhone]"
}
]
},
{
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"height": "2rem",
"width": "2rem",
"font-size": "2em",
"cursor": "pointer",
"margin": "0px 5px",
"vertical-align": "text-bottom"
}
},
{
"elmType": "span",
"style": {
"height": "2rem",
"width": "2rem",
"font-size": "2em",
"cursor": "pointer",
"margin": "0px 5px",
"vertical-align": "text-bottom",
"display": "=if([$chMail]=='','none','')"
},
"children": [
{
"elmType": "a",
"style": {
"text-decoration": "none",
"cursor": "pointer"
},
"attributes": {
"class": "ms-bgColor-neutralLighterAlt ms-bgColor-neutralLight--hover ms-fontColor-themePrimary--hover",
"iconName": "OutlookLogo",
"href": "='mailto:' + [$chMail]",
"title": "Email"
}
}
]
},
{
"elmType": "button",
"customRowAction": {
"action": "defaultClick"
},
"attributes": {
"title": "See more details",
"class": "ms-fontColor-neutralPrimary ms-fontColor-red--hover ms-fontSize-xl"
},
"style": {
"border": "none",
"background-color": "transparent",
"cursor": "pointer"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "ContactInfo"
}
}
]
}
]
}
]
}
}
Well i used your code but i have nothing to see.
In my lists are one item.
Are the columns you are using shown in the view, though?
Ah well.
Sorry i did not read your question: Can you confirm the columns are included in the View that JSON can get the fields to display content?
That was the solution. In my view i have no visiblity for the fields.
Thank you to @sympmarc and @aaclage. Have a great day.
That bites me all the time. :)
Sample (which sample are you talking about)
I want something like this
Actual Columns
Actual Code
Question
I do not saw any content. I do not find the problem. And i hope you can help me.