如何在企业Wiki页面布局中添加2个层叠下拉列表 [英] How I can add 2 Cascading Dropdown Lists inside my enterprise wiki page layout

查看:257
本文介绍了如何在企业Wiki页面布局中添加2个层叠下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在内部部署的SharePoint企业服务器2013中处理企业Wiki网站集. 现在,我想在我的企业Wiki页面布局中添加2个级联下拉列表.如下:-

I am working on an enterprise wiki site collection inside an on-premise SharePoint enterprise server 2013.Now I want to add 2 cascading dropdown lists inside my enterprise wiki page layout. As follow:-

  1. 第一个名为"company"的下拉列表.
  2. 第二个名为"department"的下拉列表
  3. 应根据所选公司填充部门.

那么任何人都可以建议我可以采用哪种方法在企业Wiki页面布局中包含2个级联的下拉列表?

So can anyone advice which approach I can follow to have 2 cascading drop-down lists inside my enterprise wiki page layout?

现在我正在考虑实现以下目标:-

Now I am thinking to implement something as follow:-

  1. 创建2个带有空选项的下拉列表类型的站点列.
  2. 将这2个站点列添加到我的企业Wiki页面布局中.
  3. 创建2个名为公司"的自定义列表"和部门".
  4. 在部门列表中定义引用公司列表的查找列.
  5. 创建一个控制台应用程序并将其安排为每运行10分钟运行一次,这将添加公司列表中的项目作为公司"站点列中的选择,并对部门列表和部门站点列进行相同的操作.
  6. 然后在页面布局内添加JavaScript,当用户选择/更改公司选择时(在创建/编辑Wiki页面时)触发.并通过对部门列表进行一些REST API调用,并获得部门项目 与所选公司相关,那么我可以隐藏与所选公司无关的所有部门选择.因此,这样只会显示与所选公司相关的部门选择..
  1. Create 2 site columns of type drop-down lists with empty choices.
  2. Add these 2 site columns to my enterprise wiki page layout.
  3. Create 2 custom lists named "company" & "department".
  4. Define a lookup column inside the department list which references the company list.
  5. Create a console application and schedule it to run each let say 10 minutes, which will add the items inside the company list as choices inside the "company" site column, and do the same for the department list and department site column.
  6. Then to add a JavaScript inside my page layout, the JavaScript will get fired when the user select/change the company choice (when creating/editing a wiki page). and by doing some rest api calls to the department list, and get the departments items which are related to the selected company, I can then hide all the department choices which is not related to the selected company. so in this way only the department choices which are related to the selected company will be shown ..

现在从理论上讲,以上应该可以实现我想要的..但​​是,如果我可以采用一种更直接/更简单的方法,那么有人可以建议我吗?我的上述方法是否有效?

Now in theory the above should achieve what I am looking for.. but can anyone advice if there is a more straightforward/simpler approach I can follow? And is my above approach a valid appraoch to go for?


附加说明.现在,在我的情况下,使用查找"字段来实现级联列表将不是100%合适的.因为我已经从(页面库>>元数据导航>>配置导航层次结构为我的Wiki页面库启用了元数据导航 ).在内部元数据导航我不能使用查找字段,因为只有单个值选择+托管元数据&内容类型可用作导航层次结构,如此处所述:-


Additional Note. now in my case using Lookup fields to achieve the cascading lists will not be 100% suitable. as i have enabled Metadata Navigation for my wiki pages library from (Pages library >> Metadata Navigation >> Configure Navigation Hierarchies ). and inside the  Metadata Navigation i can not use lookup fields, as only single value choice + managed metadata & content type are available for use as navigation hierarchies, as mentioned here:-

推荐答案

约翰,

您将需要创建第三个列表,其中涉及两个下拉列表,然后添加JavaScript代码以实现级联关系.

You will need to create a third list which will involve the two dropdown list and then add the JavaScript code to implement the Cascading relationship.

这是一个代码段,它将使用SPServices库来实现层叠下拉列表,请参见您的参考资料:

Here is a code snippet which will use SPServices library to implement Cascading Dropdown list fr yuour reference:

<script src="https://site name/jquery.min.js"></script>  
<script src="https://sitename/jquery.SPServices.min.js"></script>  
<script type="text/javascript">


(document).ready(function() {
(document).ready(function () {


().SPServices.SPCascadeDropdowns( { lationshipList:员工", lationshipListParentColumn:公司", lationshipListChildColumn:标题", parentColumn:公司", childColumn:员工", 调试:true }); }); </script>
().SPServices.SPCascadeDropdowns( { relationshipList: "Employee", relationshipListParentColumn: "Company", relationshipListChildColumn: "Title", parentColumn: "Company", childColumn: "Employee", debug: true }); }); </script>

有关逐步的详细信息,您可以参考:

For detialed step by step, you can refer:

层叠2013和Office 365上的查找下拉列表字段

SPServices库:

SPServices library:

SPServices库

谢谢

最好的问候


这篇关于如何在企业Wiki页面布局中添加2个层叠下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆