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

gridSizeChangedCallback not working

Open viethien opened this issue 5 years ago • 3 comments

I tried to use gridSizeChangedCallback, but it has never fired. this.options = { gridType: this.gridType, enableEmptyCellDrop: true, emptyCellDropCallback: this.onDrop.bind(this), gridSizeChangedCallback: this.gridSizeChanged.bind(this),

... }

How can I trigged gridSizeChangedCallback when grid size change in this case?

viethien avatar Jul 09 '19 08:07 viethien

Hi @viethien , The callback is called when number of rows or columns changed. I couldn't reproduce your issue. I tested in the demo app and the callback is called when for example I drag a item on a new column.

tiberiuzuld avatar Aug 26 '19 19:08 tiberiuzuld

I personally thought that this callback would be called whenever the width or height of the grid changed, rather than when the number of columns or rows changed. I think that might be where the confusion is coming from. I also thought this was a bug.

derekparsons718 avatar Oct 21 '20 17:10 derekparsons718

I def. have to agree with @derekparsons718. The name of the callback is misleading. I also thought it would be called everytime the actual size changed. @tiberiuzuld In my opinion the callback should not be wrapped in this condition. Or is there a better way to get to GridsterComponentInterface.gridColumns on each change?

Remark: Of course there is always the possibility to implement it yourself ;)

mspoerer avatar May 04 '21 13:05 mspoerer