AnsweredAssumed Answered

Query feature table and feature layer (map) at same time

Question asked by andreribeiro on Feb 27, 2017
Latest reply on Feb 27, 2017 by rscheitlin

I have a feature table like this example (ArcGIS API for JavaScript Sandbox). What I did is a filter to the table with differents queries like date or strings, and they are working good!

If I search for a date interval the feature table refresh and show only the records that is between that dates. What I want now is that the records on map refresh too, but I can't do that... Someone can help me please?

 

Example:

I filter the table

Only one record with this query

But the map contains all records yet and didn't refresh

 

Code:

HTML

<input id="nud" type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, intermediateChanges:true" class="dijit-form-TextBox filterTb" />
<button type="button" id="confirm">Filtrar</button>

 

Javascript

var confirmar = dom.byId("confirm");
on(confirmar, "click", function(value){
              var userVal = dijit.byId("nud").get('value');  
              var oidFld = myFeatureLayer.objectIdField;  
              var query = new Query(); 
              lastWhere = query.where = "nud LIKE '%" +  userVal + "%'";
                
            myFeatureLayer.queryIds(query, lang.hitch(this, function(objectIds) {  
               myFeatureTable.selectedRowIds = objectIds;  
               myFeatureTable._showSelectedRecords();
               }));  
});     

Outcomes