Robert,
I am getting hung up on the destroyEditor part.
var search = new Search({
map: map
}, "search");
search.startup();
search.on("select-result", lang.hitch(this, function () {
//if edit tool is enabled we'll have to delete/create
//so info window behaves correctly.
on.once(this.map.infoWindow, "hide", lang.hitch(this, function () {
search.clearGraphics();
console.log("Cleared Search Graphics");
_destroyEditor();
console.log("Test");
initEditing();
}));
}));
function _destroyEditor() {
if (this.editor) {
this.editor.destroy();
console.log("Destroyed editor");
this.editor = null;
}
}
function initEditing(event) {
var featureLayerInfos = arrayUtils.map(event.layers, function (layer) {
return {
"featureLayer": layer.layer,
"isEditable": true,
'showAttachments': true,
"showDeleteButton": false,
"fieldInfos": [{
'fieldName': 'Caller_Name',
'isEditable': false,
'tooltip': 'Caller Name',
'label': 'Caller Name:'
}, {
'fieldName': 'Priority',
'isEditable': true,
'tooltip': 'Priority',
'label': 'Priority:'
}, {
'fieldName': 'Location',
'isEditable': false,
'label': 'Location:'
}, {
'fieldName': 'Phone',
'isEditable': false,
'label': 'Phone:'
}, {
'fieldName': 'Notes',
'isEditable': true,
'label': 'Notes:'
}, {
'fieldName': 'CallType',
'isEditable': true,
'label': 'CallType:'
}]
};
});
var settings = {
map: map,
layerInfos: featureLayerInfos
};
var params = {
settings: settings
};
var editorWidget = new Editor(params, 'editorDiv');
editorWidget.startup();
//snapping defaults to Cmd key in Mac & Ctrl in PC.
//specify "snapKey" option only if you want a different key combination for snapping
map.enableSnapping();
}