我正在使用 redips 拖动类来拖放表格的表格单元格。如果目标单元格为空,我想添加一个条件以禁止丢弃。这意味着如果目标单元格不为空,我只需要“切换”。有什么帮助吗?
if (target_elements_length) {
// call myhandler_switched because clone_limit could call myhandler_clonedend1 or myhandler_clonedend2
REDIPS.drag.myhandler_switched();
// and myhandler_dropped
REDIPS.drag.myhandler_dropped(target_cell);
// if object is cloned, update climit1_X or climit2_X classname
if (cloned_flag === 1) {
clone_limit();
}
}
// otherwise element is dropped to the empty cells
else {
//TODO cancel the event.
}