Skip to content
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

how to use draggable.start / draggable.stop? #18

Closed
lwojcik opened this issue Aug 9, 2012 · 6 comments
Closed

how to use draggable.start / draggable.stop? #18

lwojcik opened this issue Aug 9, 2012 · 6 comments
Labels

Comments

@lwojcik
Copy link

lwojcik commented Aug 9, 2012

Hi. I'm playing around with Gridster (http://jsfiddle.net/lwojcik/ZCkwz/1/) and trying to bind events on start/stop dragging. The doc says that it's possible to use options draggable.start / draggable.stop. However, I have no clue how to use them (where to put them in the code). Could you provide any example of gridster call with start, drag and stop events?

@lwojcik lwojcik closed this as completed Aug 9, 2012
@lwojcik lwojcik reopened this Aug 9, 2012
@tx2z
Copy link

tx2z commented Aug 10, 2012

HI, I've "solved" the same problem :)

you have to use something like that:

        $(".gridster ul").gridster({
            widget_margins: [10, 10],
            widget_base_dimensions: [140, 140],
            draggable: {
                stop: function(event, ui){ 
                             // your events here
                }
            }
        });

Hope it help.

Saludos

@vieron vieron closed this as completed Aug 13, 2012
@lwojcik
Copy link
Author

lwojcik commented Aug 15, 2012

That's exactly what I needed. Thanks!

@hayesmaker
Copy link

agree with the poster, the documentation doesn't make this clear enough.

@mdzzaman
Copy link

many many thanks.

@ntourne
Copy link

ntourne commented Aug 28, 2013

Guys - Once stop function is called - Do you know how to get the new x and y positions? Thanks.

@bclennox
Copy link

bclennox commented Jul 2, 2014

It looks like the best way is to call serialize() or serialize_changed(), since the operation could affect more than just the widget that was dragged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants