Bala Arunjunai
Bala Arunjunai

Reputation: 3

Fix gridster container

I'm using angular-gridster2 in my angular 6 application. When ever I drag a grid, it is going beyond the container. I want to restrict the grid in moving out of my container.

I have tried giving gridType: 'fit'. but it is not working.

Upvotes: 0

Views: 644

Answers (1)

Hien Nguyen
Hien Nguyen

Reputation: 18975

You can set gridType: GridType.Fixed

And set maxCols and maxRows options to grid cols and grid rows value.

this.options.maxCols = this.gridster.gridColumns.length;
this.options.maxRows = this.gridster.gridRows.length;

It is worked in my side.

Upvotes: 0

Related Questions