English 中文(简体)
如何在SharePoint中创建子列表
原标题:
  • 时间:2009-03-14 04:33:41
  •  标签:

在SharePoint中创建子列表是否可能?我目前正在使用文件夹来组织我的内容,但访问它们时,文件夹在SharePoint中是一个完全不同的概念。

I want to achieve something like:
-web
----List A
---------Sub List 1
---------Sub List 2
----List B
---------Sub List 1
---------Sub List 2

编辑1:

我正在尝试在网站下方直接拥有可排序的列表。目前,我通过创建一个自定义文件夹,其中包括自定义的SortOrder列和Title来实现此目的。文件夹的标题最终将成为公共站点上的部分标题,每个文件夹中的项目将成为部分下面的内容。有没有更好的方法来做这件看起来相当琐碎的事情?

谢谢你的帮助 (xiè xiè nǐ de bāng zhù)

编辑2(回复Jason):

好的,我们希望内容保持有条理。比如我们有一个企业领导列表,在这个列表中我们有董事长、CEO、董事文件夹,然后每个文件夹中都有一些条目(人员)。还有更好的组织方式吗?

问题回答

具体来说,你不能在SharePoint中有嵌套列表。

然而,您可以采用多种方式,让最终用户获得类似的体验。这里有两个选择:

第一种选项是分组。包括您想分组的列(例如,对于包含城市名称的列表,您可能想按州或国家(或两者)分组),然后设置一个视图来按该列(或那些列)分组。

第二种方法是在同一网站内使用两个单独的列表,并使用查找列类型将一个列表链接到另一个列表(例如,您创建一个列表以保存国家列表,一个列表以保存州列表,以及一个第三个列表以保存包括状态和国家的查找列的城市列表)。您只能有一个层次的查找,因此您不能例如在状态列表上使用国家的查找列,然后将状态列表链接到城市列表并显示该城市所在的国家;您可以很好地显示状态(如果您在状态列表上创建一个计算列以显示“州,国家”,则可以在城市列表中显示结果),但仅此而已。

SharePoint 2007没有继承列表的支持,但是...

您可以在SP2007中的给定网站集合中拥有多个站点(实际上是Web),站点(实际上是Web)可以有子站点(实际上是子Web)。这可以用来模拟上面的“列表中的列表”。这种方法可能不是理想的,但如果所有站点(实际上是Web)都在同一网站集合中(不要与网站混淆),对于某些任务来说并不太难处理。在这种情况下,以下将是:

-Site Collection
----Web A
---------Sub List 1
---------Sub List 2
---------Web C (why not?)
----Web B
---------Sub List 1
---------Sub List 2

Here s an example where a sublist is needed (my issue :)). I am collecting textbook information for various courses in our department. I really only need the course info once and then the info for each book associated with that course:

GER 555, Textbook Title, POC (instructor) info, etc textbook title, ISBN, VER, Author etc textbook title, ISBN, VER, Author etc textbook title, ISBN, VER, Author etc

Some courses have as many as 8 books and is a pain for the instuctor to have to fill out a form every time.

You can t have sublists in SharePoint but if all of your lists are going to have the same metadata you can sure as heck have folders in document libraries. All a document library is is a list that is made to house documents. You can put subfolders in it and all of that.

That being said, I think a lot of the pushback you re seeing here is that this idea of "sublists" doesn t really get at the real power of SharePoint, which is that you re using a relational database like SQL. Ideally, you shouldn t think of "sublists", per se. What you really ought to be thinking about, I think, is different views of a list, which in and of itself is more or less a database table. Just filter out the items you want and don t want in each particular view and as far as the end users are concerned, all they see is their own data. You can then programmatically access those views simply by calling them.

SPView view = yourList.Views["View Name"];
SPListItemCollection items = list.GetItems(view);

there is no notion of a sub-list in SharePoint. You may be able to achieve the desired effect by using Lookup fields.

can you tell us a little bit more about what you are trying to accomplish?

Why do you need sub-lists at all? Why not have separate lists for each content area you want to display on the public site?


Updated:

There are a coupld of different approaches I can think of:

  1. Add a choice field to the list that categorizes each of the people. You will be able to create views to filter the items in the list, and create CAML queries for programmatically selecting the items you are interested in. You should be able to easily segment the list for displaying on the public page.

  2. If these are job titles, they could be stored in AD and brought into SharePoint via the profile import functionality. You could then develop web part (one may already exist), to show users with specific profile properties (in this case Title )

I have managed to create document sets (SharePoint 2010) in a custom list. It was a bit accidental and I m not sure if it is wise to do this (happy to take advice).

I wanted to partition a list by "Organisation" and I wanted to have a Minutes Document Set for each Organisation, containing the Minutes for each respective Organisation. The steps I used:

  • Created content type for Minutes based on list item
  • Created content type for Minutes Document Set based on Document Set
  • Created custom list for Minutes
  • Added both Minutes and Minutes Document Set as content types
  • Removed Document as a content type for the list

Now I can create Minutes Document Sets in the list and add Minutes list items to those document sets - the proviso is that I m creating the document sets using PowerShell as when I try to do it using the browser, SharePoint tells me I cannot (which is weird because at one point I did in fact create a document set using the browser but somewhere along the way this stopped working).

When accessing a document it will not display the Document Set view. That view is specifically for libraries and SharePoint will complain if you try to use it to display the contents of a Document Set in a list.

As I mentioned above, this was something of an accident that occurred because I wasn t aware that you weren t supposed to be able to do this. Use at your own risk.

I think the real issue is hindering on "sub-lists". If it is a "lists in s list", then I think it is inaccessible. At least in the best of my knowledge.

If you are just want link two lists in different sites or folders whatever, as long as they are under same site collection, it can be done. (If I light-read read your post,then sorry! pause your reading!) There are couple of approaches:

  1. Take a look at t this post.
  2. Tools like Sharepoint List Collection or Sharepoint Cascaded Lookup may be your ideal way. The trouble is most of them are operated through data view.

Hope it helps PS. It is a good question!





相关问题
热门标签