Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

how to close the editor function

$
0
0
I create an editor widget according to the example https://developers.arcgis.com/en/fle...ode/editor.htm. The code is shown as following. It works well. The problem is when i close this widget, the editor still work. So how to close the editor function when this edit widget closed. And I also find if i set the popup information in the config.xml, when i use the editor and click the map, the popupinfo will automatic come out and sometime cover the editor windows. I try to used the map.infoWindows.hide(), but it does't work. So how to make the popupinfo windows invalid temperately? Any suggestion will be appreciated.



<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:viewer="com.esri.viewer.*"
widgetConfigLoaded="basewidget_widgetConfigLoaded()"
xmlns:esri="http://www.esri.com/2008/ags">
<fx:Script>
<![CDATA[
import com.esri.ags.components.Editor;
import com.esri.ags.layers.FeatureLayer;

import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;

[Bindable]
private var myFeatureLayer:FeatureLayer=null;
//private var myEditor:Editor=null;
private function basewidget_widgetConfigLoaded():void
{
if (configXML)
{
var strDisRepFeatureName:String=configXML.content;//get featurelayer name
var layerIds: ArrayCollection= map.layers as ArrayCollection;
for each(var oneLayer: Object in layerIds)
{
if(oneLayer is FeatureLayer)
{
var oneFeatureLayer:FeatureLayer= oneLayer as FeatureLayer;
if (oneFeatureLayer.name==strDisRepFeatureName)
{
myFeatureLayer=oneFeatureLayer;
break;
}
}
}

if(myFeatureLayer!=null)
{
myFeatureLayer.outFields=["OBJECTID","Workplace","Name",
"Postion","officePhoneNumber","mobilephoneNumber","homePhoneNumber","mem","GroupName"];

myFeatureLayer.mode="snapshot";
myEditor.featureLayers = [ myFeatureLayer ];
map.infoWindow.hide();

}
else
{
Alert.show("Load data failed!", configData.configXML.title);
}
}
else
{
Alert.show("Can not find widget confige data!", configData.configXML.title);
}

}

]]>
</fx:Script>

<fx:Declarations>
<esri:GeometryService id="myGeometryService" url="http://localhost/ArcGIS/rest/services/Geometry/GeometryServer"/>
</fx:Declarations>


<viewer:WidgetTemplate id="attrEditDisReporter"
width="250" height="300"
minWidth="250" maxWidth="250"
minHeight="300" maxHeight="300">
<viewer:layout>
<s:HorizontalLayout paddingLeft="5"
paddingRight="5"
paddingTop="2"/>
</viewer:layout>

<esri:Editor id="myEditor"
width="100%" height="180"
geometryService="{myGeometryService}"
map="{map}"/>
</viewer:WidgetTemplate>
</viewer:BaseWidget>

Viewing all articles
Browse latest Browse all 2097

Trending Articles