Last active
August 29, 2015 14:02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
that._getData = function (navTermID, listName, xmlQuery, contentType, onGetSuccess) { | |
var objClientCtx = new SP.ClientContext.get_current(); //can be reused | |
if (objClientCtx) { | |
var oList = objClientCtx.get_web().get_lists().getByTitle(listName); | |
var query = new SP.CamlQuery(); | |
query.set_viewXml(xmlQuery); | |
var objlistItems = oList.getItems(query); | |
objClientCtx.load(objlistItems); | |
objClientCtx.executeQueryAsync(function (sender, args) { | |
that.DataSet = []; | |
var objlistEnumerator = objlistItems.getEnumerator(); | |
while (objlistEnumerator.moveNext()) { | |
var objListItem = objlistEnumerator.get_current(); | |
var firstName = objListItem.get_item('FirstName'); | |
var lastName = objListItem.get_item('LastName'); | |
var email = objListItem.get_item('Email'); | |
that.DataSet.push({ | |
"FirstName": firstName, | |
"LastName": lastName, | |
"Email": email, | |
}); | |
} | |
onGetSuccess(that.DataSet); | |
}, function (sender, args) { | |
that._onGetFail(sender, args); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment