基于行的动态列
我正在做的事情可能真的很愚蠢,如果是这样,请纠正我,但我正在尝试做以下事情:
我想要一个包含(例如)以下项目的列表:
List Addresses
-Name
-Address
-City
-Country
但是,根据他们的国家/地区,我想要显示我想要在列表中记录的不同列。例如:
CountryColumns
(United States - SSN - Yes)
(United States - State - Yes)
(United States - Province - No)
(United Kingdom - SSN - No)
(United Kingdom - State - No)
(United Kingdom - Province - Yes)
然后当用户在国家列表中选择美国时,下次用户编辑其信息时,将显示某些列。 (也有可能全部显示,而下次带有“否”的列将被隐藏)。
我已经研究过执行此操作的方法,并且我只发现 Infopath 能够执行此操作。但是,这意味着我必须为每个国家/地区创建不同的视图,并显示/隐藏某些列。这似乎有点矫枉过正了。
有人知道如何做到这一点吗?
问候,
垫子
What I am doing might be really stupid, if so, please correct me, but I am trying to do the following thing:
I want to have a list with (for example) the following items:
List Addresses
-Name
-Address
-City
-Country
But, based on their Country, I want to display different columns that I want to record in a List. For instance:
CountryColumns
(United States - SSN - Yes)
(United States - State - Yes)
(United States - Province - No)
(United Kingdom - SSN - No)
(United Kingdom - State - No)
(United Kingdom - Province - Yes)
And then when the user picks United States in the country list, the next time the user edits his information, certain columns will be shown. (It's also possible that all will be shown, and that the next time the columns with No will be hidden).
I've looked at ways to do this, and I only found out that Infopath is able to do this. But, that'd mean I would have to create a different view for every country, and show / hide certain columns. It seems like that is a bit of overkill.
Anyone knows a way how to do this?
Greetings,
Mats
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下是三个选项:
Here are three options:
您可以通过四种方式修改 SharePoint 来实现此目的。
有一个列表地址内容类型,然后为每个需要额外字段的国家/地区提供单独的内容类型。使用 Web 部件使用正确的国家/地区内容类型将数据输入到列表中。
与上面相同,但您可以使用基地址内容类型将数据添加到列表中,而不是通过 Web 部件输入数据。使用项目添加事件接收器来决定将数据添加到哪种内容类型。
使用一种包含所有字段但具有自定义列表视图页面的超级内容类型来根据县值过滤字段。
将 infopath 与每个国家/地区的单独视图或每个特殊字段的一个部分结合使用,如果未选择所需的国家/地区,则将其隐藏。
我个人推荐4。它是最简单、最快实现的。
There are four ways you could modify SharePoint to do this that come to mind.
Have a list address content type and then a separate content type for each country that requires extra fields. Use a webpart to enter data to the list using the correct country's content type.
Same as above but instead of entering data through a web part, you can add the data into the list using the base address content type. Use an item adding event receiver to decide which content type to add the data to.
Use one super content type that includes all fields but with custom list view pages to filter the fields based on the county value.
Use infopath with either separate views for each country or a section for each special field with a condition to hide it if the required country isn't selected.
Personally I would recommend 4. It's the simplest and quickest to implement.
您无法开箱即用地执行此操作。
You cannot do this out of the box.