function addEditor(r){ var contentHolder = "<div id='editorDiv'></div><div id='tmpDiv'></div>"; $j('##editDiv').append(contentHolder); var templateLayers = dojo.map(r,function(result){ return result.layer; }); var widget = new esri.dijit.editing.TemplatePicker({ featureLayers: templateLayers, grouping: true, rows: 'auto', columns: 3 },'tmpDiv'); widget.startup(); var layers = dojo.map(r, function(result) { return {featureLayer:result.layer}; }); var settings = { map: map, templatePicker: widget,// <------- templatePicker for editor -----> geometryService: new esri.tasks.GeometryService(GEOSERVICE), layerInfos:layers, toolbarVisible: true, createOptions: { polylineDrawTools:[ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYLINE], polygonDrawTools: [ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON, esri.dijit.editing.Editor.CREATE_TOOL_CIRCLE, esri.dijit.editing.Editor.CREATE_TOOL_TRIANGLE, esri.dijit.editing.Editor.CREATE_TOOL_RECTANGLE ] }, toolbarOptions: { reshapeVisible: true } }; var params = {settings: settings}; myEditor = new esri.dijit.editing.Editor(params,'editorDiv'); myEditor.startup(); }
I was playing with this a bit again. Its kinda funny. I can make a new editor and I can make an attribute inspector but I cant make them work together. Once I run the editor.startup() it overrides my attribute inspector. Should the attribute editor be tied to the editor settings? Mine is not and I feel like it should.
Currently I have the attribute inspector and editor both using layerInfos to get their display information but other than that they are independent. I'm thinking this shouldn't be the case. Can someone please clarify this for me?
I am more than happy to share code.