Hi, I have searched high and low and there simply isn't a way to determine if a feature have been selected on a layer in ArcGIS Javascript 3.xx. (in PRO SDK, its literally a one-liner)
My use-case requires me to determine the features that are selected in the attribute-table widget and the only way I can achieve that is by digging in the layer and search for _graphicalVal. I am sure there must be a proper way to do this, perhaps through a proper API? Would anyone be able to advise?
I could not find anything in the layers api, layersInfo/Struct/Node etc api
Solved! Go to Solution.
Victor,
Where is your code that needs to know the selected features? In a Widget or in one of the jimu.js mangers? Normally I would get a reference to the AT widget and then _activeTable.layerInfo or .layer to get the layer that the active table represents. You can get an array of selected OIDs from the _activeTable.selectionRows variable or get the actual selected features(graphics) using _activeTable.layer.getSelectedFeatures()
Victor,
Where is your code that needs to know the selected features? In a Widget or in one of the jimu.js mangers? Normally I would get a reference to the AT widget and then _activeTable.layerInfo or .layer to get the layer that the active table represents. You can get an array of selected OIDs from the _activeTable.selectionRows variable or get the actual selected features(graphics) using _activeTable.layer.getSelectedFeatures()
Thank you so much Robert Scheitlin, GISP that is very helpful.
Cheers