在SharePoint表单中的字段之前添加标头 [英] Adding header before fields in SharePoint forms

查看:49
本文介绍了在SharePoint表单中的字段之前添加标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我们要求在SharePoint表单中为列表"A"添加标题。此列表有10个字段。我们需要在"新表单aspx"中添加标题。 


字段为1)标题


2)导演评论


3)董事 批准


4)经理评论


5)经理批准


6)主管评论


7)主管 批准 


8)其他评论


9)帐户名称 


10)评论


我想在上述字段之前添加标题。我需要作为"导演"标题在主任评论之前  ,  "经理" "经理评论"之前的标题,"主管"在"主管评论"之前的标题
和  "使用者"标题前面的标题"评论" 


我写了一个Javascript来创建标题(插入一行背景颜色为字符串) 在字段之前通过比较字段的索引。它适用于其他要求,但不适用于此场景。问题是,我的代码正在查看"评论"。
页面中的单词并在其他字段的前面放置包含注释字的标题。由于这个导演评论有2个标题,"导演"和"用户" 。用户标题应该在"评论"之前。字段不是导演评论。 



提前致谢 


解决方案


您可以使用jQuery属性选择器来获取完全匹配的元素并添加标题元素上方。


下面的脚本将获得div(多行提交)id以评论开头。

 


('div [id ^ ="Comments"]' )



$


您可以查看以下链接,了解更多可用的选择器。


http://api.jquery.com/category/selectors/



最好的问候,



Hello,

We have a requirement to add headers in SharePoint forms for a list "A". This list has 10 fields. We need to add headers in the "New form aspx". 

The fields are 1) Title

2) Director Comments

3) Director Approval

4) Manager Comments

5) Manager Approval

6) Supervisor Comments

7) Supervisor Approval 

8) Additional Comments

9) Account Name 

10) Comments

I want headers before the mentioned fields. I need as "Director" header Before Director comments  ,  as "Manager" header before "Manager Comments ", "Supervisor" header before "Supervisor Comments" and  "User" header before "Comments" 

I wrote a Javascript to create headers(insert a row with a background color for string)  before field by comparing index of the field. It is working fine for other requirement, but not for this scenario. The issue is, my code is looking at the "comments" word in page and placing header infront of other fields which contains Comments word. Because of this director comments have 2 headers, "Director" and "User" . User header should be before "Comments" field not Director comments. 

Thanks in advance 

解决方案

Hi,

You could use jQuery attribute selector to get the exact matched element and add the header above the element.

Below script will get the div(multiple line filed) by id begin with Comments.


(‘div[id^="Comments"]’)


You could check below link for more avaliable selectors.

http://api.jquery.com/category/selectors/

Best Regards,

Lee


这篇关于在SharePoint表单中的字段之前添加标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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