选中您的SharePoint表单:列表到选项卡(需要向jquery脚本添加更多内容)

问题描述 投票:0回答:1

我正在使用Mark Rackley提供的一个非常有用的脚本:https://www.youtube.com/watch?v=GSmuailCvKI(我做了一些小的调整,但脚本在这里找到http://www.markrackley.net/2015/12/03/tabify-your-sharepoint-forms/)。该脚本运行良好,但我试图添加代码,允许我在特定选项卡中选择我想要的特定字段。例如,现在如果我使用'Size 5'创建'Tab 1',第一个选项卡将自动从我的可用字段列表中选择前5个字段。

在我目前的项目中,mt first tab与'Finance'相关。这意味着我只需要从我的字段列表中的字段1,5,16,20和25。字段2-4与财务无关,因此我在第一个选项卡中不需要它们。

我想知道这是否可行,或者唯一的选择是按照我需要它们的顺序编辑我的列表并只使用当前脚本。任何帮助表示赞赏。提前致谢。

<script  type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<link  type="text/css" rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/ui-lightness/jquery-ui.css" /> 
<script type="text/javascript" src="//code.jquery.com/ui/1.11.3/jquery-ui.js"></script> 

<script type="text/javascript" src="//www.markrackley.net/scripts/jquery.HillbillyTabify.min.js?rev=1"></script> 

<div id="HillbillyTabifyDiv"><ul id="HillbillyTabify"></ul></div>

<script type="text/javascript">

    jQuery(document).ready(function($) {
        //the example below creates 3 tabs, you can create as many tabs as you'd like by adding additional objects.
        //"Title" is the title of the tab and "size" is the number of fields to show in that tab
        //If there are any remaining fields they will appear as normal below the tabs
        var tabInfo = [
            {title:"Title 1",size:3},
            {title:"Title 2",size:4},
            {title:"Title 3",size:5}
        ];

        HillbillyTabifyForms(tabInfo);

    });

</script>
jquery sharepoint web-parts editview
1个回答
0
投票

如果您使用的是默认的编辑/新/显示表单,则只需重新排序列表中的字段。

如果您要创建自定义编辑/新建/显示表单,则应进入SharePoint Designer,并重新排序编辑表单中的字段,新表单,列表中的显示表单。

当你完成重新排序时,它会为每个标签选择你想要的字段

© www.soinside.com 2019 - 2024. All rights reserved.