update flow layout drag demo

This commit is contained in:
王劲鹏 2022-08-26 14:32:57 +08:00 committed by osborn
parent 13c151a9e4
commit 11c6c72792

View File

@ -44,8 +44,19 @@ class FlowLayoutDragDemo extends Panel {
loge('visible Items is:', ret2)
},
canDrag: true,
itemCanDrag: (from) => {
if (from === 0) {
return false;
} else {
return true;
}
},
beforeDragging: (from) => {
if (from === 0) {
return new Array(this.data.length + 1).fill(0).map((_, index) => index)
}
loge(`beforeDragging from: ${from}`)
return [0, 1, 2, 9, 10, 15]
},
onDragging: (from, to) => {
loge(`onDragging from: ${from}, to: ${to}`)