rollinsio

esri.dijit.editing.Editor not starting correctly

Discussion created by rollinsio on Sep 13, 2010
Latest reply on Oct 28, 2010 by rollinsio
I am creating a map using the JavaScript API.  For some reason, despite verifying everything against the samples, my Editor will not startup correctly.  In Chrome I'm getting a "DOM exception 8", which is indicative that an object is not in the DOM when it is referenced.  When I inspect the div which the editor should be contained in, there are plenty of nested divs, but I'm not sure which ones may be missing.

I'm putting everything in Ext components.  So far, the map and the template picker work correctly, just not the editor.

Any help would be greatly appreciated.

Here is the code for the function to set up the template picker and the editor:

[PHP]
initEditor: function(results){

       
       
        var editorPanel = this.get('editorpanel');
        var templatePickerPanel = editorPanel.get('templatepickerpanel');
        var editorWidgetPanel = editorPanel.get('editorwidgetpanel');
       
        var layers = dojo.map(results, function(result) {
            return {featureLayer:result.layer};
          });
       
        var templateLayers = dojo.map(results, function(result){
            return result.layer;
        });
       
        this.templatePicker = new esri.dijit.editing.TemplatePicker({
            featureLayers: templateLayers,
            group: true,
            rows: 'auto',
            columns: 2
        }, templatePickerPanel.body.dom);
       
        this.templatePicker.startup();
       
        var settings = {
            map: this.map,
            templatePicker: this.templatePicker,
            geometryService: new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"),
            layerInfos: layers,
            toolbarVisible: true,
            createOptions: {
            polygonDrawTools: [ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON,
                                esri.dijit.editing.Editor.CREATE_TOOL_POLYGON,
                                esri.dijit.editing.Editor.CREATE_TOOL_AUTOCOMPLETE]
            },
            toolbarOptions: {
                reshapeVisible: true,
                cutVisible: true,
                mergeVisible: true
            }
        };
        var params = {settings: settings};

        this.editorWidget = new esri.dijit.editing.Editor(params, editorWidgetPanel.body.dom); 
        this.editorWidget.startup();
    }
[/PHP]

Outcomes