Open austenstone opened 3 years ago
It's simple.
options: GridsterConfig = {
enableOccupiedCellDrop: true
}
I would appreciate a
emptyOccupiedDropCallback?: (event: MouseEvent, item: GridsterItem) => void;
similar to emptyCellDropCallback
and to pair with enableOccupiedCellDrop
If we can get the handle to GridsterItem
from checkCollision
it would be nice to check if item has some new property droppable
inside the function getValidItemFromEvent
.
I haven't looked how you convert GridsterItem
to GridsterItemComponentInterface
and not sure how good of a design this would be.
Kind of like this....
angular-gridster2\src\lib\gridsterEmptyCell.service.ts
getValidItemFromEvent(e: MouseEvent, oldItem?: GridsterItem | null): GridsterItem | undefined {
....
....
if (!this.gridster.$options.enableOccupiedCellDrop) {
let c = this.gridster.checkCollision(item);
if (!c || c.droppable) {
return item;
}
return;
}
return item;
}
Hi @astone2014 did you successfully implemented this callback? I have the same use case as yours.
Thanks.
I can't bind drop events to a
gridster-item
and I haven't been able to find anyGridsterConfig
settings to allow this.Notice not draggable like the empty grid.
How can I override the default behavior that prevents dropping on a
gridster-item
? I want to do this for specific items.I actually prefer to do this