在Sharepoint的自定义字段中生成文本的HTML [英] Generating HTML of text in custom fields in Sharepoint

查看:108
本文介绍了在Sharepoint的自定义字段中生成文本的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,由于Microsoft已决定关闭此功能,因此我们正在尝试寻找一种替代方案,用于在Sharepoint的自定义字段中显示和控制HTML.

相反,我们一直在尝试将JSON格式的数据作为纯文本输出到自定义字段中.
然后使用JavaScript查找列-解析数据,然后生成HTML来替换JSON内容.

我们的问题是,哪些字符被认为是特殊字符"?并且仍然可以在自定义字段中将JSON数据作为文本打印出来.
我们的字段是计算字段"类型,并包含类似于以下内容的值:

=" {'workflow':'开始',
'action':'Edit',
'item-id':'& id&" ,,
'onclick':'script.runAction(this)',
'text':'Edit'}'"

然后,该代码段将在列表的一栏中写为:

{'workflow':'Start','action':'Edit','item-id':'1','onclick':'script.runAction(this)','text':'Edit'}


Hi, we're trying to find an alternative solution for displaying and controlling HTML in custom fields in Sharepoint - since Microsoft have decided to turn off the functionality.

We've instead been experimenting with printing out data in JSON-format as pure text in custom fields.
Then finding the columns with JavaScript - parsing the data and then generate HTML to replace the JSON content with.

Our question is which characters are considered "special characters" and will it still work to print out JSON data as text in custom fields.
Our field is of the type "Calculated field" and contains a value similar to the following: 

="{'workflow':'Start',
'action':'Edit',
'item-id':'"&id&"',
'onclick':'script.runAction(this)',
'text':'Edit'}"

This snippet would then be written out in a column in the list as:

{'workflow':'Start', 'action':'Edit', 'item-id':'1', 'onclick':'script.runAction(this)', 'text':'Edit'}

Will this be possible after Microsoft pulls the plug on generated HTML on September 10th?

推荐答案

我们可以使用Calculated字段在列表视图中显示HTML,检查如下:

We can use Calculated field to show HTML in list view, check as below:

1.创建一个自定义字段(计算字段).

1. Create a custom field(Calculated field).

2.将以下文本添加到公式中.

2. Add the following text into Formula.

="<input id='"&ID&"' type='button' value='Edit' onclick='alert(1)'/>"

3.设置从此公式返回的数据类型为: Number(1,1.0,100)

3. Set The data type returned from this formula is:Number(1,1.0,100)

最好的问候,

丹尼斯


这篇关于在Sharepoint的自定义字段中生成文本的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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