Ranga,
Everytime the table's 'selection-change' event is fired it provides a list of rows added or removed from the selection. So after you set up the FeatureTable, set up a watch on that event such as:
// Get the FeatureLayer's layerView and listen for the table's selection-change event
// Here I'm maintaining a list of features for use elsewhere
let lstFeatures = [];
aFTable.on("selection-change", function (changes) {
var idxItem = 1;
// If the selection is removed, remove the feature from the array
changes.removed.forEach(function (item) {
const data = lstFeatures.find(function (data) {
return data.feature === item.feature;
});
if (data) {
lstFeatures.splice(lstFeatures.indexOf(data), 1);
}
});
// If the selection is added, push all added selections to array
changes.added.forEach(function (item) {
const feature = item.feature;
lstFeatures.push({
feature: feature
});
});
zoomToSelectedFeature(aLayer, lstFeatures, aView);
});