I haven't explored using the editor widget but here is a code sample that should get you started:
function mergeLines(graphicsArray) { // merge geometries of polyline graphics into one geometry (graphics array could be map.graphics.graphics, featureLayer.graphics, etc.) var polyline = new Polyline(map.spatialReference); for (var i = 0; i < graphics.length; i++){ var paths = graphics.geometry.paths; for (var j = 0; j < paths.length; j++){ //needed for multi part lines polyline.addPath(paths); } } return polyline; } var mergedGraphicGeometry = mergeLines();
If you have your own API deployed on your server go to the file (https://js.arcgis.com/3.18/esri/dijit/editing/Editor.js) and find:
function(a){return"esriGeometryPolygon"===a.geometryType&&a.visible&&a._isMapAtVisibleScale()}
To fix the bug with merging the above must be replaced with:
function(a){return a.geometryType&&a.visible&&a._isMapAtVisibleScale()}
For some reason Esri is checking if the geometry type is polygon before UNION function is used on the geometry server? WHY???
Removed "esriGeometryPolygon"===a.geometryType
Everything working as expected.
Hope this helps.
Regards,
Andrzej