I have some code build by someone else and I am trying to alter some form values when an event is dispatched
Here is the line of code
_instance.dispatchEvent ( "ADD_ROW", { 'container' : $li, 'value' : data } );
What I can't seem to do on a global level is do something like this
someGlobalVariable.addEventListener('ADD_ROW', function (e) { console.log(11111); }, false);
or
document.querySelector('body #an_id').addEventListeneraddEventListener('ADD_ROW', function (e) { console.log(11111); }, false);
I don't know where the ADD_ROW is added or what global object I have to look at.
_instance looks like this on console.log
Object { _listenerMap: Object, indexOfListener: AbstractEventDispatcher/instance.indexOfListener(), addEventListener: AbstractEventDispatcher/instance.addEventListener(), removeEventListener: AbstractEventDispatcher/instance.removeEventListener(), hasEventListener: AbstractEventDispatcher/instance.hasEventListener(), dispatchEvent: AbstractEventDispatcher/instance.dispatchEvent(), release: AbstractEventDispatcher/instance.release(), rowCount: JSONFieldSetList/_instance.rowCount(), addRow: JSONFieldSetList/_instance.addRow(), deleteRow: JSONFieldSetList/_instance.deleteRow(), 4 more… }
Is there a way I can track what is happening and where the event is dispatched?