Created
July 11, 2014 22:25
-
-
Save asizer/56f82d11be0e1c223599 to your computer and use it in GitHub Desktop.
Make dojo xhrRequest work with secured service
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
/* all this is around line 334 of SQLQuery/Widget.js */ | |
// option 1 is to query the rest endpoint for unique values. | |
// option 2 is to store featureSet clientside (1000 limit) | |
var tokenRequest = esri.id.findCredential(this.activeInfo.fLayerUrl); // THIS IS NEW! | |
if (!this.activeInfo.featureSet) { | |
dojoXhr(this.activeInfo.fLayerUrl + '/query', { | |
query: { | |
where: '1=1', | |
outFields: fieldInfo.name, | |
returnDistinctValues: true, | |
f: 'json', | |
returnGeometry: false, // don't forget to add a comma here... | |
token: tokenRequest ? tokenRequest.token : null // THIS IS ALSO NEW! | |
}, | |
headers: { | |
'X-Requested-With': null | |
}, | |
handleAs: "json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment