Closed bjschwarz closed 5 years ago
Hi @bjschwarz .
These events you mentioned are configured insite the options
on Vis. Therefore we can pass the event in the configuration object on vue2vis. Check this fiddle: https://jsfiddle.net/ygcj2ehb/
We could though emmit
an event by default on this but I don't think thats implemented. @alexcode who implemented this may know better.
Regards,
@Menighin Thanks for the response. I also tried the method you suggested. The problem I ran into is there is no access to the vue object within a callback passed to Vis. The "this" object is not within the functions scope. Any ideas how to get around this?
Hi @Menighin @bjschwarz
Did you manage to find a solution for this?
I have a similar issue. I'm trying to call a Vue method from within a groupTemplate. Same issue - see https://jsfiddle.net/ers37v98/1/
@bjschwarz, an arrow function will share the current scope
onMove: () => alert("move: " + JSON.stringify(this.selectedId)),
@alexcode Thanks for the jsfiddle. I think if all the item data was set on select then the onMove would be accurate for the last selected object. Looks like it should work.
In the Vis library you can pass in callbacks within the options of the timeline. Such as onMove, onRemove, etc (vis). I can't find a way to use this in the vue scope. Is there a way to bind these or an alternate route?