#1
  1. hiding my <b> from ur <strong>
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2004
    Posts
    959
    Rep Power
    181

    JQuery droppable div move not recognized


    This problem is best illustrated with the image below. I'm attempting to create a div that rows can be dragged in to, in a certain order. A placeholder pops up showing where the dragged row would land if let go.



    In the illustration, I'm slowly dragging the row (the white hovering block) down the Clara and Jeremy box, past row 5. As I've passed halfway down row 5, you'll see that a blank place holder row has appeared underneath, showing where the new row would pop up.

    I've created a script to alert the number of the row you're currently hovering over.
    Code:
    // drop task into sprint
    	$('.sprintTask').droppable({
    		tolerance: 'intersect',
    		over: function(event,ui) {
    			cursprintord = $(this).attr('sprintord');
    			alert('intersected' + cursprintord);
    		}
    	});
    I continued to pull the row down halfway into the blank row, which is where the image above shows. You can see in the image that the script has alerted that I've passed over row 4, even though I haven't. Instead, I'm starting to pass over the area that USED to be occupied by that row, but is currently occupied by the placeholder.

    I would think that I'm just messing up somewhere else, like the placeholder is quickly being removed, etc., but it's not. Note also that the placeholder row isn't even a class of "sprintTask", so it's not a droppable area.

    Any idea what might be going on here? Does the droppable range somehow not update based on the movement of the div itself?

    Thanks,
    Jeremy
    Last edited by daprezjer; June 23rd, 2013 at 11:14 PM.
    ****
    Enjoy my post? Drop some props by hitting the scales button up top. JBL

    Website Design in Los Angeles and Washington, DC by PoweredPages.com
  2. #2
  3. hiding my <b> from ur <strong>
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2004
    Posts
    959
    Rep Power
    181
    As sometimes happens, writing out my post lead me to think of better Google search terms, and I found:

    refreshPositions: true

    for draggable. Hope this helps someone.
    ****
    Enjoy my post? Drop some props by hitting the scales button up top. JBL

    Website Design in Los Angeles and Washington, DC by PoweredPages.com

IMN logo majestic logo threadwatch logo seochat tools logo