我需要在共享点列表的编辑表单中显示 ID 字段。
有办法吗?我尝试了一个计算字段,但什么也没有。 我知道我可以在 View 中看到 ID 字段,并且如果我显示为访问模式。 我使用的是WSS3.0
最佳答案
您可以add the ID field to the form using some JavaScript in a CEWP .
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
</script>
<script type="text/javascript">
$(function() {
// Get the ID from the query string
var id = getQueryString()["ID"];
// Find the form's main table
var table = $('table.ms-formtable');
// Add a row with the ID in
table.prepend("<tr><td class='ms-formlabel'><h3 class='ms-standardheader'>ID</h3></td>" +
"<td class='ms-formbody'>" + id + " </td></tr>");
})
function getQueryString() {
var assoc = new Array();
var queryString = unescape(location.search.substring(1));
var keyValues = queryString.split('&');
for (var i in keyValues) {
var key = keyValues[i].split('=');
assoc[key[0]] = key[1];
}
return assoc;
}
</script>
还有一个替代方案method that doesn't use the jQuery library如果您希望保持轻量级。
关于sharepoint - 如何在共享点列表的编辑表单中将 ID 字段显示为只读?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3300662/