Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to show content type in button alert- sharepoint 2010

$
0
0

Hello All,

I have written a JavaScript code to show the list alert on ribbon button click.
The alert is showing the Titles and Content Type Ids in the alert, I don't know
How to display the Content Type name instead of Content type ids????


please refer the following code snippet

function onQuerySucceeded(sender, args) 
{
var listItemInfo = '';
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) 
{
var oListItem = listItemEnumerator.get_current();
listItemInfo += '\nID: ' + oListItem.get_id() +
'\nTitle: ' + oListItem.get_item('Title')+
'\nContent Type: ' + oListItem.get_item('ContentTypeId');
}
alert(listItemInfo.toString());
}

Somebody please help me soon


In this line I tried to replace the parameter as ContentType instead of ContentTypeId but it failed!

'\nContent Type: ' + oListItem.get_item('ContentTypeId');


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>