To remove the shape_ columns you need to specify this in the datagrid.Change:<mx:DataGrid dataProvider="{queryTask.executeLastResult.attribu tes}" scroll="true" width="100%" height="40%"/> To:<mx:DataGrid dataProvider="{queryTask.executeLastResult.attributes}" scroll="true" width="100%" height="40%">
<mx:columns>
<mx:DataGridColumn dataField="PARCELID"/>
</mx:columns>
</mx:DataGrid>The query doesn't work because your query is still looking for PARCELID which isn't an attribute in the land use and zoning layers, you need to change the doQuery function to change this dynamically.private function doQuery():void
{
if (myLAYER.selectedItem.data == 2) {
query.outFields = ['ZONING_CODE'];
}
else if (myLAYER.selectedItem.data == 1) {
query.outFields = ['LANDUSE_CODE'];
}
queryTask.execute(query, new AsyncResponder(onResult, onFault));
}Also be aware that this is a case sensitive search, the default value you have in the search box is a parcel id, so you'll need an exact zoning or land use code to search with. You'll also need to change the dataField value on the DataGridColumn as well.