tvjsx/trading-vue-js

Event "object-selected" should return the object

leoplaw opened this issue · 1 comments

this.comp.$emit('object-selected')

Event object-selected should return the object so listener can identify which object emitted it.

this.comp.$emit('object-selected', this)

I tried hacking this into the code, but it does not seem to work. So perhaps it is the wrong place?

tool-selectedevent returns the originating tool which emitted the event.
object-selected does not.

On the object-selected event, the chart.data.selectedis not populated, so the following is not possible: this.chart.get(this.chart.data.selected)

So far the method that does work is to use a watcher.

    'chart.data.selected': function(newValue, oldValue) {
      if (newValue) {
        console.log("TVJS: selected:",newValue)
        const selected = this.chart.get(newValue)
        console.log("TVJS: Object Selected:",selected)
      }
    }