I followed the script to display only the selected records on the feature table after you select by geometry as it is shown at:
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=highlight-features-by-geometry
However, the featuretable does not filter out the unselected records.
function selectFeatures(geometry) {
if (featureLayerView) {
// create a query and set its geometry parameter to the
// rectangle that was drawn on the view
const query = {
geometry: geometry,
outFields: ["*"]
};
// query graphics from the csv layer view. Geometry set for the query
// can be polygon for point features and only intersecting geometries are returned
featureLayerView
.queryFeatures(query)
.then((results) => {
const graphics = results.features;
resultFeatures = graphics;
if (results.features.length === 0) {
clearSelection();
} else {
// pass in the query results to the table by calling its selectRows method.
// This will trigger FeatureTable's selection-change event
// where we will be setting the feature effect on the csv layer view
console.log(featureTable)
featureTable.filterGeometry = geometry;
featureTable.selectRows(results.features);
}
})
.catch(errorCallback);
}
}
