I am trying to write a SharePoint web part for an on-line SharePoint-hosted site. I have looked around but can't find more than how to access a basic list. I need to access a list created by the Image Libary app, but when I look at the list columns in my admin UI, I can only see text columns, and I have only figured out how to access these text columns in my js code:"
var oneList = this.web.get_lists().getByTitle("RotatingBannerImages");
var query = new SP.CamlQuery();
this.listItems = oneList.getItems(query);
context.load(listItems);
context.executeQueryAsync(
Function.createDelegate(this, successHandler),
Function.createDelegate(this, errorHandler)
);
function successHandler() {
var itemEnum = listItems.getEnumerator();
while (itemEnum.moveNext()) {
var item = itemEnum.get_current();
console.log(item.get_item("Title")); // Returns null on image list.
}
}
The expression item.get_item("Title")
returns a list item title when I access a plain text list, which I used to establish my API code before moving on the Image Library list. Nearly everything I try in the debugger returns an object, which needs another round of method calls just to inspect it.