How can I access the data returned by serviceXhr? I want to access the series array in the function that called getSeries function. But It seems the data is retrieved in the successCallback and I can't get the data outside of it?
getSeries:function archive_list__getSeries(archiveList) {
this.serviceXhr({
url: AlfConstants.PROXY_URI + "/rl/archive/archive-list-series?archiveList=" + archiveList,
method: "GET",
successCallback: function (response) {
var series = [];
if (response && response.result)
{
var seriesData = response.result;
seriesData.sort(this.naturalSort);
for (var i=0; i<seriesData.length; i++)
{
var row = {
name: "alfresco/lists/views/layouts/Row",
config: {
widgets: [
{
name: "alfresco/lists/views/layouts/Cell",
config: {
widgets: [
{
name: "alfresco/html/Label",
config: {
label: seriesData[i].title + " (" + seriesData[i].id + ")"
}
}
]
}
},
this.getSeriesAddAction(seriesData[i].nodeRef)
]
}
};
series.push(row);
}
}
},
callbackScope: this
});
},