【发布时间】:2022-01-05 08:03:55
【问题描述】:
一直在编写一些示例代码,以根据列表列 A 的值格式化列表列 B。
我有 2 个列表: 列表 A - 此列表是数据输入的主要列表。列是项目、地区和国家。 列表 B - 此列表包含 2 列;地区和国家。
我想要做的是,根据用户选择,只显示与选择区域对应的国家。所有国家/地区都保存在列表 B 中。
到目前为止我已经尝试过:
{
"$schema": "https://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"elmType": "div",
"style": {
"display": "inline-block",
"padding": "10px 0 10px 0",
"min-height": "auto"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 10px 0 0"
},
"attributes": {
"iconName": "Folder"
}
},
{
"elmType": "a",
"txtContent": "Show Countries",
"attributes": {
"target": "_top",
"href": {
"operator": "+",
"operands": [
"https://xxxxxxxxxxxx/AllItems.aspx?ID=",
"@currentField.lookupValue",
"[$Title]",
"&FilterType1=Lookup"
]
}
}
}
]
}
这显然不是正确的解决方案,但对于 JSON 来说,这是我通过参考 msdn 文档所能做的最好的事情。尽管最终解决方案不需要该链接,但该链接可以正常工作。基本上,我只希望用户根据地区选择看到国家。因此,我错过了显示查找值而不是“显示国家/地区”的结果。
非常感谢任何帮助或指向进一步帮助/文档的指针。
【问题讨论】:
标签: json sharepoint cascadingdropdown sharepoint-list