Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event "object-selected" should return the object #267

Open
leoplaw opened this issue Mar 17, 2022 · 1 comment
Open

Event "object-selected" should return the object #267

leoplaw opened this issue Mar 17, 2022 · 1 comment

Comments

@leoplaw
Copy link

leoplaw commented Mar 17, 2022

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?

@leoplaw
Copy link
Author

leoplaw commented Mar 17, 2022

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)
      }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant