4.28 Feature table. highlightIds vs selectRows(deprecated) change.

113
1
Jump to solution
02-26-2024 07:18 AM
MatthewDriscoll
MVP Alum

I am trying to update some code, getting rid of deprecated items.  I am trying to change my feature table selections from selectRows() to highlightIds.add(), but I am having trouble.  I am guessing I am needing to add some more lines of code getting graphics first?  Any help will be appreciated.

https://codepen.io/mbdriscoll/pen/GReBgYd?editors=1000

 

parcelLayer.queryFeatures(query)
        .then(function(response) {
          // Open the popup with the queried features
          theView.openPopup({
            features: response.features,
            featureMenuOpen: true,
            featuresPerPage: 100,
          });
          addButtonToContainer();
          if(response.features.length === 0){
                alert("Search query found no results.");
                return
            }else{
              for(let iii=0; iii < response.features.length; iii++){
                //console.log(response.features[iii])
                //featureTable.selectRows(response.features[iii]);
                featureTable.highlightIds.add(response.features[iii]);
                console.log(featureTable.highlightIds.add(response.features[iii]))
                featureTable.filterBySelection();
              }
            };
        });

 

 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

Looks like you are adding the features. You want to add the OBJECTID

response.features[iii].attributes.OBJECTID

You can see this sample here.

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-featuretable-pop...

View solution in original post

1 Reply
ReneRubalcava
Frequent Contributor

Looks like you are adding the features. You want to add the OBJECTID

response.features[iii].attributes.OBJECTID

You can see this sample here.

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-featuretable-pop...