4

All board is filled by widgets, without margin. And when i try to move element from one column(1) to another(2) the elements at column 2 just go down out of the board like:

errormovewidget

I'd like to forbid placing a widget to a place if there is no place for widgets in the column.

My code:

   gridster = $(".gridster > ul").gridster({

          widget_margins: [mySizeDetector.blockMargin, mySizeDetector.blockMargin], 
          widget_base_dimensions: [mySizeDetector.dx, mySizeDetector.dy], /*[width, height]*/
          min_cols: mySizeDetector.xCount,
          min_rows: mySizeDetector.yCount,
  }).data('gridster');

Thanks in advance!

2 Answers2

0

I think you can restrict it go in x-axis beyond the container, but not in y-axis.

Because we have min_cols and max_cols to restrict it in x-axis. But we have only min_rows but not max_rows.

You can refer the documentation: http://gridster.net/#documentation

Ashish Kumar
  • 2,991
  • 3
  • 18
  • 27
-1

have a look at the gridster fork by Dustin Moore. Download the .js and the .css File.

Excerpt form the link:

Widgets of smaller or equal size to the dragged widget (player) will swap places with the original widget.

This causes tiles to swap left and right as well as up and down.

By default smaller players will shift larger widgets down.

I have added an option to prevent this behavior:

    $.gridster({
        shift_larger_widgets_down: false
    });
Marco
  • 319
  • 4
  • 13