Hi, my code of DragHelper :
this.Drag = new bryntum.scheduler.DragHelper (
{
cloneTarget : true,
mode : 'translateXY',
dropTargetSelector : '.b-timeline-subgrid',
targetSelector : '.b-grid-row:not(.b-group-row)',
grid : this.UnplannedGrid,
schedule : this.scheduler,
constrain : false,
outerElement : this.UnplannedGrid.element,
createProxy(element) {
const
proxy = document.createElement('div'),
task = this.grid.getRecordFromElement(element),
durationInPx = this.schedule.timeAxisViewModel.getDistanceForDuration(task.duration);
console.log('task:'+task);
//task:{"id":"a105r000001GRRNAA4","name":"VI-000003"}
console.log('task.duration:'+task.duration);
//task.duration:9
console.log('durationInPx:'+durationInPx);
//durationInPx:0.000010416666666666666
// Fake an event bar
proxy.classList.add('b-sch-event-wrap', 'b-sch-event', 'b-unassigned-class', 'b-sch-${schedule.mode}');
proxy.innerHTML = `<div class="b-sch-event b-has-content b-sch-event-withicon">
<div class="b-sch-event-content">
<i class="${task.iconCls}"></i> ${task.name}
</div>
</div>`;
if (this.schedule.isHorizontal) {
proxy.style.height = `${this.schedule.rowHeight - (2 * this.schedule.resourceMargin)}px`;
proxy.style.width = `${durationInPx}px`;
}
else {
proxy.style.height = `${durationInPx}px`;
proxy.style.width = `${this.schedule.resourceColumnWidth}px`;
}
console.log('proxy.style.width:'+proxy.style.width);
return proxy;
},
during drag, the cell size is 4 days.
Another question, how to add drop event ?
BR