IntroductionIn this article you will see how to get the list content types in SharePoint 2010 using ECMAScript. I have a list named "List Request" which has the following content types (Navigate to the list, click on List tab in the ribbon interface. Click on List Settings button).
Steps Involved
function onQuerySucceeded() { var contentType = 'List Content Types:\n ' var contentTypeEnumerator = this.contentTypeCollection.getEnumerator();
while (contentTypeEnumerator.moveNext()) { var content = contentTypeEnumerator.get_current(); contentType += content.get_name() + '\n'; } alert(contentType); }
function onQueryFailed(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
ReferenceSP.List.contentTypes Property - http://msdn.microsoft.com/en-us/library/ee556719.aspx SummaryThus in this article you have seen how to get the list content types in SharePoint 2010 using ECMAScript.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: