AnsweredAssumed Answered

Selected feature in dgrid not passing objectID to relationQuery

Question asked by JJhill on Jan 12, 2018
Latest reply on Jan 17, 2018 by rscheitlin

I have a watchUtil for a popup opening, to trigger a related table query. Works perfectly when a user clicks on a feature on the map but when a grid row is clicked the relationshipQuery doesnt return any results.

 

                  watchUtils.when(app.view.popup, "selectedFeature", function photos(evt){
                       console.log(app.view.popup.selectedFeature);
                       query("#panelDetails").removeClass("in");

                       var objectID = app.view.popup.selectedFeature.attributes.OBJECTID;
console.log(objectID);
                       var queryTask = new QueryTask({
                            url: "https://services.arcgis.com/ZzrwjTRez6FJiOq4/arcgis/rest/services/Core_Locations_20171129/FeatureServer/0"
                       });

                       relationQuery = new RelationshipQuery({
                            objectIds: [objectID],
                            outFields: ["Filename", "directory", "TYPE", "Usage", "Top_Depth", "Bottom_Depth"],
                            relationshipId: 1
                       });
console.log(relationQuery);
                       queryTask.executeRelationshipQuery(relationQuery).then(function(rslts){

                         document.getElementById("attDetails").innerHTML = "";
                         //No rslt given back here when clicking on dgrid
console.log(rslts);
                                       var features = rslts[objectID].features;
console.log(features);

Outcomes