Bug Tracker

Ticket #3232 (closed bug: invalid)

Opened 6 years ago

Last modified 6 years ago

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

Reported by: ErMasca Owned by:
Priority: major Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

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, buut when you try to 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

});

});

Change History

comment:1 Changed 6 years ago by flesler

  • Status changed from new to closed
  • Resolution set to invalid

This belongs to jQuery UI. Please repost this to the  UI Bug Tracker.

Note: See TracTickets for help on using tickets.