Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm attempting to access items in a DocumentSet using SharePoint 13's JSOM. I am able to access the generic list properties but I do not see how to access ContentType specific properties on the client side. I have a DocumentSet with PDF's and I need the Name property of the items in the DocumentSet.

function GetContentItem() {
      context = new SP.ClientContext.get_current();
      lstStudents = context.get_web().get_lists().getByTitle('My Asset Library');
      web = context.get_web();
      currentUser = web.get_currentUser();
      context.load(currentUser);
      context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod),
                              Function.createDelegate(this, this.onFailureMethod)); 
    }

function onSuccessMethod(sender, args) {
       var camlQuery = new SP.CamlQuery();

       camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">' + getTitle() + '</Value></Eq></Where></Query></View>');
       this.ContentListItems = lstStudents.getItems(camlQuery);
       context.load(ContentListItems);
       context.executeQueryAsync(Function.createDelegate(this, this.showContentData),
                              Function.createDelegate(this,  
       this.onFailureMethod));
    }

//This where I am confused. I do not understand how to access the properties of
//'list' within the DocumentSet

function showContentData()
    {
        var listItemEnumerator = ContentListItems.getEnumerator();
        var mainContainer = document.getElementById('mainContentContainer');

        while (listItemEnumerator.moveNext()) {
            var div = document.createElement('DIV');
            var oListItem = listItemEnumerator.get_current();
            div.innerHTML += 'ID: ' + oListItem.get_id() + 
                'Title: ' + oListItem.get_item('Title');
            div.innerHTML += '<br/>' + oListItem.get_folder();

            mainContainer.appendChild(div);
            }

    }
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.