-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag'n'resize widgets #69
Comments
It's pretty easy to adobt jquery resizable with gridster. Done it in one project. Everything works just fine if you use latest jqueryui. |
@cyberfoxlt - do you have some example code, perhaps a jsFiddle? I very briefly experimented with Gridster + Resizable, but stopped shy of trying to convert between pixel width/height into gridster col/row. http://jsfiddle.net/singram/PdjLE/ |
Parts of my code: http://jsfiddle.net/PrtrR/2/embedded/result/ |
Good, but one problem - jQuery UI. Add this framework for one function? Not rationally, is it? And native support will be more stable I think.. |
@cyberfoxlt - thanks for the fast response and spot-on example -- I'm fine with using jQuery-UI. However, I think your code reveals a bug in the Gridster resize logic. It doesn't always push other widgets out of the way when one is resized. To see this in action, perform these steps on your jsFiddle:
The result is that "Logo" overlaps "Ads Small" although the grey "Main" widget slides down as though it's making room for "Ads Small" to move, even though it doesn't. Furthermore, you can now drag and drop "Ads Small" anywhere on top of "Logo." The above steps are only one example. Try shrinking the green "Ads Top" widget" as step 0 and making the Logo wider in step 2. I added debugging output, and you are correctly calculating the new height and width. You pass these correct values to Gridster's resize_widget(), but, Gridster isn't correctly relocating the other widgets, at least not visually. Other unsized widgets respond as though the incorrectly stationary widgets have actually moved to where they were supposed to... so Gridster is mentally moving the resized widgets, but not visually... and playing with it more, I see that moving a resized widget will restore correct behavior. Should this be filed as a bug? "Resizing a widget makes it immune to layout changes until it is subsequently manually moved." From: cyberfoxlt notifications@github.com Parts of my code: http://jsfiddle.net/PrtrR/2/embedded/result/ |
Hi, |
Anyone got any ideas on this? I see this consistently when resizing a widget to the right into the last row of widgets. The last row does not update and stays put. |
In order to resolve this issue i did a small hack of removing the widget by calling: remove_widget |
The issue is actually a conflict between jquery resizable and gridster it's a simple fix, see my fork: https://github.com/maxgalbu/gridster.js |
Thx for this fix! |
has anyone gotten extra_rows option to work? I'm trying to put a few extra rows at the bottom of the grid, so that the drag to resize can fill them in, but the option doesn't seem to do anything for me. Also, is there a way to bind a function to after gridster does it's initial layout, so that I could just change the height of the gridster ul after load? ideas? thx, |
Hi there! I'm trying to get this working in a windows 8 store app to display some images...i imputed the above code from http://jsfiddle.net/maxgalbu/UfyjW/ and got it to display in the app..its works pretty well but i would like it to expand to the right instead of the bottom...how can set the height to stay the same and have the right right expand when needed? If i could just turn the entire grid counter clock wise and keep the elements the right way that would be perfect..but obviously i know its not that easy hahah |
I have the same problem as timatron. Everything works fine, except if you want to expand an element at the very bottom at the gridster container. It automatically expands itself when you drag and drop elements, but not when you resize objects. I assume you have to trigger the dragging.start event manually if you want to do that, but I can't find a way to make it work! Adding additional rows using "extra_rows" would also be a workaround, but somehow gridster just ignores it when I append this to the configuration. Any ideas? |
Same boat. On Fri, Feb 8, 2013 at 6:14 AM, Powernap notifications@github.com wrote:
|
Hi, |
@kfirdado Check that the horizontal containment works as expected. The vertical resize works great, but it allows you to resize outside the horizontal boundary and messes up the rest of the grid on stop. |
Any proper fix for the bottom problem? |
He @gotwig, Did you have a look at the last mentioned fiddle? This solution is almost working, except in firefox. But the problem with this browser is not so big; it's just that firefox bugs with the used event property offsetY. // we need event property offsetY,
// but firefox bugs with this
// so we set this by our own
// @see http://bugs.jquery.com/ticket/8523#comment:16
if(typeof event.offsetX === "undefined" || typeof event.offsetY === "undefined") {
var targetOffset = $(event.target).offset();
event.offsetX = event.pageX - targetOffset.left;
event.offsetY = event.pageY - targetOffset.top;
} |
Hi, I want to resize only few widgets. Any ideas Thanks |
You can set the resizable containment property so the widgets can't be resized outside of the grid. Example: http://jsfiddle.net/UfPvA/30/ |
This feature has been added into gridster: 8a09444 |
Some like that form, where I writing this feature-request now. Just normally resize, but with sticking to the grid. With big grids with small step (100x100 grid, 5px step) it can be useful)
Thanks!
The text was updated successfully, but these errors were encountered: