Hi all,
Not a seasoned developer, so this might have a very simple answer that I'm failing to see/understand.
I'm trying to build a custom widget from scratch, and most of my code gets executed when a button is clicked in the widget interface (it's a portal map services search). I am using a global variable that needs to be manipulated at various stages (i.e. events). To keep this as short as possible my code looks something like this:
... addedLayers: [], //This is the global variable postCreate: ... startup: ... customFunctionOnButtOnclick: function() { map = this.map; var addedLayers = this.addedLayers; ... on(map, "layer-remove", function(event) { |