October 27, 2024
Chicago 12, Melborne City, USA
javascript

How do I use onDropObjectOnItem for vis timeline


I was wondering how do I use onDropObjectOnItem for vis timeline? The documentation seems to be very poor, as I’m using TypeScript. I’m trying to drag <span> elements into the timeline.

I’ve tried the official examples, but documentation is poor. I can’t provide the code I’m working on. However, this is the example that I’m working with visjs.github.io/vis-timeline/examples/timeline/other/…. The issue is that the JS code is not well documented and the official documentation does not assist either.

Here’s where I’m at:

onDropObjectOnItem: function(taskItem: HTMLElement, callback (taskItem as HTMLElement) => void) {     
    // Add item to timeline     
    this.timeline.add(taskItem);     
   
    console.log('Added item to timeline.');

    callback(taskItem);
}



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video