I'm not sure if i'm overlooking things or this is not yet supported, but i'm curious if the default JavaScript API (v4) popup supports related records.
I have the following situation:
Example in default JSAPI popup:
Example in Webappbuilder:
What i'm looking for is the option to add the functionality regarding the related records in the second screenshot to the situation in the first screenshot.
My question is twofold:
Robert,
That worked like a charm! Thank you. I expanded a little bit on it and am now getting the related records as a response after selectedFeature changes:
The code I used (might not be pretty, but it works):
watchUtils.when(view.popup, "selectedFeature", function(evt){
console.log(view.popup.selectedFeature);
var url = view.popup.selectedFeature.layer.url;
var layerId = view.popup.selectedFeature.layer.layerId;
var fullURL = url + "/" + layerId;
var objectID = view.popup.selectedFeature.attributes.OBJECTID;
var queryTask = new QueryTask({
url: fullURL
});
relationQuery = new RelationshipQuery({
objectIds: [objectID],
outFields: ["*"],
relationshipId: 0
});
queryTask.executeRelationshipQuery(relationQuery).then(function(results){
console.log(results)
});
});
Now what I've got to do is append this to the content property of the popup.
I'll keep this thread updated.
I like to use dojo dom-construct for building html elements and then domConstruct.place to add them. You can use dojo query to get the infoWindow dim node to append to.
Is there a road map / timeline when editing related records will be possible with the JS API v4?
Thx
Jim Barry or anyone else from the dev-team?
Annina,
Just FYI Jim is not on the development team.
Thanks, Robert, I just took his name because he figures as responsible for this space. Maybe he can transfer the question to someone in charge 🙂
Sorry for the delay on this. Checking with the dev team to see what they say.