【发布时间】:2019-11-06 20:43:52
【问题描述】:
尝试在 SharePoint 列表中实现水平平铺/按钮视图,以使用关联的列表属性 webpart,但是项目选择不起作用,如果可能,请在 JSON 中寻找解决方法。
我尝试寻找可以以相同方式工作的 customRowAction 设置,但一无所获。 "hideSelection": "true",似乎完全关闭了选择项目的能力。
我希望能够单击列表项并将其重新注册为“选定”项以触发关联的列表属性 webpart 以显示项内容。 OOTB 此功能按预期运行,但与 JSON 中显示的列表视图样式不同。
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": "true",
"hideColumnHeader": "true",
"rowFormatter": {
"elmType": "div",
"style": {
"float": "left"
},
"children": [
{
"elmType": "button",
"customRowAction": {
"action": "defaultClick"
},
"attributes": {
"class": "ms-bgColor-themeLighterAlt ms-bgColor-themePrimary--hover ms-fontColor-white--hover"
},
"style": {
"display": "flex",
"flex-wrap": "wrap",
"min-width": "150px",
"min-height": "50px",
"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 "
},
"txtContent": "[$Phase]"
}
]
}
]
}
]
}
}
【问题讨论】:
标签: json listview sharepoint-online web-parts