I create a feature layer from external service(JSON data). All the fields of the feature layer display in the popup. There is one custom field i.e. for eg 'Test_id' which has a unique value for each feature(not ObjectId). When I open any popup I get a selected index popup feature and from that feature/attributes, I fetch the 'Test_id' field value to perform some action. If I set field visibility false in the popup field Infos then in popup features I am not getting that field but I want that field to perform some logic and at the same time I want that field is not displayed in the popup UI.
Issues: If I set field visibility false in the popup field Infos then in popup features I am not getting that field.
Question: How can I get the 'Test_id' field value from popup selected index features if field visibility is false in the popup fieldInfos? If visibility is true in the popup field Infos then how to display none for that field in the popup UI
Solved! Go to Solution.
This sample shows how to define the fields of the popup but the content is set by a function which creates the text using the features attributes. So you can set the popups content and choose not to use your test_id field in the popups content.
This sample shows how to define the fields of the popup but the content is set by a function which creates the text using the features attributes. So you can set the popups content and choose not to use your test_id field in the popups content.
Ok if that field is not in popup content then should I get that field value in mapView.popup.features[mapView.popup.selectedFeatureIndex]
mapView.popup.selectedFeature.attributes.YourFieldName
Nope. Your requirements need to conform to methods available.
Thanks popup content solution worked.
One thing which i observed if pagination in popup template(multiple features) and i zoom in map then on click of next in popup pagination, popup pointer not change to selected index feature position.
Question:- Why popup anchor pointer not changing to selected feature on click of next/previous in popup pagination.
I have not run into that. But maybe look at this link and the "updateLocationEnabled" property
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open