angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

Drag and Drop configure to show different number of shadow cells?

Open ysk3a opened this issue 4 years ago • 1 comments

Hello. First, thank you for this great library. The large amount of demos provided are very helpful as well! I was hoping to get some help for this specific implementation. I was combining the parent dynamic widget demo and empty cell drop to add demo to drag and drop various item to the grid, which was no problem. But the problem is as follows:

image The provided demo only shows 1x1 cell shadow. But I was wondering if there was a way to customize the number of shadow cells depending on the item that is being dragged around in the grid.

For example, if the item to be dragged is predefined to be 2 col and 1 row and another item to be 3 col and 2 row is there a way to show/shadow that if I dragged a 2x1 on to the grid I'll see a 2x1 'shadow' when dragging.

ysk3a avatar Jun 12 '21 06:06 ysk3a

Hi @HCyberViper , The only way to change the size of the dragged item in this case is to change the defaultItemCols and defaultItemRows in the options when you start the drag from the outside. Relevant code: https://github.com/tiberiuzuld/angular-gridster2/blob/master/projects/angular-gridster2/src/lib/gridsterEmptyCell.service.ts#L222

Have a nice day

tiberiuzuld avatar Jun 12 '21 07:06 tiberiuzuld