angular-gridster2
angular-gridster2 copied to clipboard
gridSizeChangedCallback not working
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?
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.
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.
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 ;)