简体   繁体   English

SharePoint 2010清单

[英]SharePoint 2010 List

I have the following code that uses SharePoint SP jQuery to get autocomplete from a list which works perfect. 我有以下代码,这些代码使用SharePoint SP jQuery从工作正常的列表中获取自动完成功能。

However: 然而:

  1. How can I include more columns in the code? 如何在代码中包含更多列?

  2. It would not accept some of the column names such as [User ID] or [User Email/Name]. 它不接受某些列名,例如[User ID]或[User Email / Name]。

I'm thinking because of the / or the space in the column name. 我在想是因为/或列名中的空格。 How can I eliminate that in the code instead of changing the column name in SharePoint list? 如何在代码中消除这种情况,而不是更改SharePoint列表中的列名?

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script type="text/javascript" src="/sitename/JQuery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="/sitename/JQuery/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$().SPServices.SPAutocomplete({
sourceList: "MyListName",
sourceColumn: "User",
columnName: "User",
numChars: 2,
ignoreCase: true,
slideDownSpeed: 100,
debug: true
});
});
</script>

Space should not be an issue. 空间应该不是问题。

Note that, sourceColumn is a static name. 请注意, sourceColumn是静态名称。

http://spservices.codeplex.com/wikipage?title=%24().SPServices.SPAutocomplete http://spservices.codeplex.com/wikipage?title=%24().SPServices.SPAutocomplete

StaticName 静态名称

StaticName (as opposed to DisplayName) means the underlying column name, eg, Region_x0020_Name. StaticName(与DisplayName相反)表示基础列名称,例如Region_x0020_Name。 This is also sometimes called the 'internal name' for the column. 有时也称为列的“内部名称”。 The DisplayName would be Region Name, ie, the name of the column which is shown on forms and as the header in list views. DisplayName将是“区域名称”,即在表单上显示并在列表视图中作为标题的列的名称。 Probably the easiest way to determine the StaticName if you don't know it is to go to List Settings and click on the column name link. 如果您不知道,确定静态名称的最简单方法可能是转到“列表设置”,然后单击列名称链接。 When you get to the column properties page, check the URL. 当您进入列属性页面时,请检查URL。 It will end in something like this: / layouts/FldEdit.aspx?List=%7B37920121%2D19B2%2D4C77%2D92FF%2D8B3E07853114%7D&Field=Potential%5Fx0020%5FValue The StaticName is the value for the Field parameter at the end. 它将以以下形式结束:/ layouts / FldEdit.aspx?List =%7B37920121%2D19B2%2D4C77%2D92FF%2D8B3E07853114%7D&Field = Potential%5Fx0020%5FValue StaticName是末尾Field参数的值。 This is a little tricky because some of the characters are further encoded. 这有点棘手,因为某些字符已被进一步编码。 Any occurrences of '%5F' need to be replaced with an underscore ' '. 任何出现的'%5F'需要替换为下划线' '。 Examples: 例子:

Potential%5Fx0020%5FValue -> Potential_x0020_Value Child%5Fx0020%5FSite%5Fx0020%5FName -> Child_x0020_Site_x0020_Name Potential%5Fx0020%5FValue-> Potential_x0020_Value Child%5Fx0020%5FSite%5Fx0020%5FName-> Child_x0020_Site_x0020_Name

DisplayName 显示名称

DisplayName (as opposed to StaticName) means the name of the column which is shown on forms and as the header in list views, eg, Region Name. DisplayName(与StaticName相反)表示列的名称,该列显示在表单上并作为列表视图中的标题显示,例如Region Name。 The StaticName would be Region_x0020_Name, ie, the underlying column name. 静态名称将为Region_x0020_Name,即基础列名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM