tiberiuzuld/angular-gridster2

is there a way to change grid matrix?

Opened this issue · 1 comments

if i have a large screen resolution the max cols is 3 but when it is resize to smaller resolution i need to make it as 2 cols
is there a way to do that ?

i tried this code but it didn't work
@HostListener('window:resize', ['$event']) onResize() { const width = window.innerWidth; if (width < 1500) { this.options.maxCols = 2; } else { this.options.maxCols = 3; this.options.maxRows = 12; } if (this.options.api && this.options.api.optionsChanged) { this.options.api.optionsChanged();\ } }

Are you using as gridsterType fit option? you can also add a method in the gridSizeChangedCallback