Function
$().SPServices.SPGetDisplayFromStatic
Functionality
This function returns the
DisplayName for a column based on the
StaticName. This simple utility function, which utilizes the GetList operation of the Lists Web Service, seemed useful to expose as a public function.
Prerequisites
None
Syntax
$().SPServices.SPGetDisplayFromStatic ({
webURL: "",
listName: "",
columnStaticName: ""
});
webURLThe URL of the Web (site) which contains the listName. If not specified, the current site is used. Examples would be: "/", "/Accounting", "/Departments/HR", etc. Note: It's always best to use relative URLs.
listNameThe name or GUID of the list. If you choose to use the GUID, it should look like: "{E73FEA09-CF8F-4B30-88C7-6FA996EE1706}". Note also that if you use the GUID, you do not need to specify the relationshipWebURL if the list is in another site.
columnStaticNameThe
StaticName of the column
Example
The following example will return the
DisplayName for the Title column in the States list in the current site.
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery.SPServices-0.4.6.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices.SPGetDisplayFromStatic ({
listName: "States",
columnStaticName: "Title"
});
});
</script>