private function doSearch():void { myAttributeTable.featureLayer = myFeatureLayer var defexpr:String = searchattribute + eqsymbol + "'" + qText.text + "'"; yourTable.definitionExpression = defexpr myAttributeTable.featureLayer = yourTable Alert.show(defexpr) totalGraphicsShown = "Total records shown: " + (yourTable.graphicProvider as ArrayCollection).length
Solved! Go to Solution.
var defexpr6:String = "DateComplete >= " + "'" + date1.text + "'" + " AND DateComplete <= " + "'" + date2.text + "'"; // var defexpr:String = searchattribute + eqsymbol + "'" + qText.text + zerotime + "'"; yourTable.definitionExpression = defexpr6 myAttributeTable.featureLayer = yourTable myAttributeTable.visible = true; Alert.show(defexpr6) query.where = defexpr6; query.objectIds=[]; query.returnGeometry = false; queryTask.executeForIds(query); var objectIdsArray = []; function executeForIdsOnResult(event:QueryEvent):void { queryTask.removeEventListener(QueryEvent.EXECUTE_FOR_IDS_COMPLETE,executeForIdsOnResult); objectIdsArray = event.objectIds; numberofrecords.text = objectIdsArray.length.toString(); }
<esri:QueryTask id="queryTask" url="http://tfsgis-iisd01:6080/arcgis/rest/services/SARS_WILSON/RELATED_TABLES/FeatureServer/1" executeForIdsComplete="executeForIdsOnResult(event)" useAMF="false" /> <esri:Query id="query" outFields="" returnGeometry="false" /> <mx:Text width="65" id="numberofrecords" text="test"/>
var query:Query = new Query(); query.where = defexpr query.returnGeometry = false; yourTable.queryCount(query, new AsyncResponder(onResult, onFault)); function onResult(featureSet:FeatureSet,token:Object = null):void { } function onFault(info:Object, token:Object = null):void { } <esri:QueryTask id="queryTask" url="http://tfsgis-iisd01:6080/arcgis/rest/services/SARS_WILSON/RELATED_TABLES/MapServer/1"/>
function onResult(count:Number, token:Object):void { trace(count); }