我有两个链接的时间线,所以我想知道无论如何在这两个时间线之间拖动项目。
第一个时间线是Queue,第二个时间线是 my Main Timeline。所以我想让我可以将项目拖放Queue到Main timeline,反之亦然。
这是我的两个时间表。
主要时间线选项:
var options = {
onMove: function (item, callback) {
console.log('content', item)
},
onAdd: function (item, callback) {
console.log(item)
callback(item)
},
start: new Date(),
end: new Date(1000 * 60 * 60 * 24 + (new Date()).valueOf()),
min: new Date(2018, 0, 1),
max: new Date(2019, 0, 1),
zoomMin: 1000 * 27 * 24 * 24, // if you want to zoom more in then lower the 27
zoomMax: 1000 * 60 * 60 * 24 * 31 * 3,
stack: false,
showMajorLabels: false, // hide date
showMinorLabels: false, // hide time
autoResize: true,
orientation: 'top',
editable: {
add: true,
updateTime: true,
updateGroup: true,
overrideItems: false,
remove: true
}
}
this.mainTimeline = new visTimeline.Timeline(container)
this.mainTimeline.setOptions(options)
this.mainTimeline.setGroups(groups)
this.mainTimeline.setItems(items)
this.mainTimeline.on('rangechange', function (properties) {
self.mainProperties = properties
})
队列选项:
var options = {
onMove: function (item, callback) {
console.log('content', item)
},
start: new Date(),
end: new Date(1000 * 60 * 60 * 24 + (new Date()).valueOf()),
min: new Date(2018, 0, 1),
max: new Date(2019, 0, 1),
zoomMin: 1000 * 27 * 24 * 24, // if you want to zoom more in then lower the 27
zoomMax: 1000 * 60 * 60 * 24 * 31 * 3,
autoResize: true,
orientation: 'top',
editable: false
// editable: {
// add: true,
// updateTime: true,
// updateGroup: true,
// overrideItems: false,
// remove: true
// }
}
this.queueTimeline = new visTimeline.Timeline(container)
this.queueTimeline.setOptions(options)
this.queueTimeline.setGroups(groups)
this.queueTimeline.setItems(items)
this.queueTimeline.on('rangechange', function (properties) {
self.queueProperties = properties
})
有什么解决方案吗?谢谢!
