Skip to main content

Search and Top Navigation

#3172 closed bug (notabug)

Opened August 09, 2008 04:28PM UTC

Closed September 16, 2008 01:29PM UTC

Last modified October 11, 2012 09:15PM UTC

UI sortables update event not firing when sorting within same div sorting in multiple sortable divs

Reported by: ErMasca Owned by: paul
Priority: major Milestone:
Component: ui.sortable Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

hope the code attached helps my bug description. I have found that when you have a layout made out of divs as "zones" and little divs within "parts". when sorting from zone to zone works just fine, but when you sort within the same div the update event doesnt fire.

$(document).ready(

function () {

var sortableChange = function(e, ui){

if(ui.sender){

var w = ui.element.width(); ui.placeholder.width(w); ui.helper.css("width",ui.element.children().width());

}

};

var sortableUpdate = function(e, ui){

if(ui.sender){

var w = ui.element.width();

ui.placeholder.width(w);

ui.helper.css("width",ui.element.children().width());

var zones = $('.part').not(".ui-sortable-helper"); var wp = ; for(var x=0; x<zones.length; x++) {

if(wp.length > 0){wp+='&';}

var pid = $('#'+zones[x].id).parent(".wpzone").attr("id");

wp+=pid+'='+zones[x].id;

}

alert(wp);

}

};

$('.wpzone').sortable({

cursor: 'move',

items: $('.part'),

handle: $('.titlebar'),

opacity:90,

zIndex:10000,

dropOnEmpty:true,

containment:'document',

placeholder:'sortHelper',

helperclass: 'sortHelper',

activeclass :'sortableactive',

hoverclass : 'sortHelper',

appendTo: 'body',

tolerance:'intersect',

refreshPositions:true,

connectWith: $('.wpzone'),

delay:0,

distance:5,

scroll:true,

scrollSensitivity:50,

revert:true,

cursorAt: {top:15,left: 10 },

start: function(e,ui) { ui.helper.css("width", ui.item.width()); },

change: sortableChange,

update:sortableUpdate

});

});

Attachments (0)
Change History (3)

Changed August 17, 2008 10:14AM UTC by Cloudream comment:1

component: ui.coreui.sortable
milestone: → TDB

Changed September 16, 2008 01:29PM UTC by paul comment:2

resolution: → invalid
status: newclosed

I already see the problem here. In the sortableUpdate function, you're checking for ui.sender, which only exists if you move from one connected list to another, and later on call alert(wp), but wp isn't created without ui.sender.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:3

milestone: TBD

Milestone TBD deleted