gridster.js icon indicating copy to clipboard operation
gridster.js copied to clipboard

Drag and drop widgets anywhere on a blank grid.

Open dustmoo opened this issue 12 years ago • 10 comments

This is useful in having a flexible grid.

This is kind of happening with the bug here:

https://github.com/dustmoo/gridster.js/issues/2

However it isn't deliberate. There should be an option to change this behavior.

dustmoo avatar Mar 01 '13 01:03 dustmoo

+1

bompus avatar May 29 '13 05:05 bompus

I'm not sure of the side effects, but I was able to accomplish this with the following:

Search for: if (pp !== false) {

Replace with: if (pp !== false && 1 === 2) {

Obviously this isn't a real fix, but it shows that if "pp" returns false, that it turns it into a blank canvas without the columns above requirement. I tested it quite a bit and couldn't see any negative.

bompus avatar May 29 '13 07:05 bompus

On second look.. This makes the placeholder/preview hard to position where you want it as it really can move anywhere, so this needs some refining.

bompus avatar May 29 '13 15:05 bompus

+1

DeepAnchor avatar Oct 01 '13 22:10 DeepAnchor

+1 for me too, would be great to have this.

WhiskeyJack avatar Oct 02 '13 06:10 WhiskeyJack

just a heads up, I found a repo with similar functionality here:

repo: https://github.com/dagen-niger/fluidGrid.js demo: http://dagenniger.ipage.com/fluidGrid/demo.html

though it seems to only be a proof of concept at this time

DeepAnchor avatar Oct 04 '13 16:10 DeepAnchor

Any updates on this feature? I do like the little 'hack' @bompus figured but as he said, it's pretty unpredictable and not quite solid. So I was wondering has there been any progress with this?

kurbar avatar Apr 25 '14 13:04 kurbar

I need it too. +1

willstdueswissen avatar Jun 11 '14 19:06 willstdueswissen

Working after the hack of @bompus did I found that if it's false, its because its under a item. Otherwise it will return a row number for the widget. If that number you add +1 you get your widget one row down.

if (pp !== false) {
    to_row = pp+1;
}

Still haven't found the solution. It must create more grid coords and allow widget to use them I guess. Some one else working on this?

sbehrends avatar Sep 05 '14 03:09 sbehrends

Ok... other approach I found is returning false function can_go_player_up() and can_go_widget_up(). So add a "return false;" right afterwards the function is declared.

Now to have a fixed amount of rows to move around you must override the set_dom_grid_height() function. (I did not found the min_rows applied). So for testing purposes I just set var r = 6 (I wanted six rows). Probably the best method would be to apply here min_rows.

sbehrends avatar Sep 05 '14 03:09 sbehrends