Hi all,

Iäve built some functionality in a CMS where you can drag and drop
small elements on the page between 2+ panes/containers/divs. Whenever
a drag-drop event has occurred (onUpdate) I make a Ajax.Request to
save the new layout in the CMS.

The code is as follows:

in an onload-function:
var a = ["subcontent", "main"];
for (var i=0; id=a[i]; i++) {
    if ($(id)) {
        Sortable.create(id, {
            only: ['PEti','PElist','PEform','PEcal','PEwi', 'PEcol'],
            tag: 'div',
            handle: 'pageElementEdit',
            ghosting: false,
            containment: a,
            overlap: 'vertical',
            dropOnEmpty: true,
            hoverclass: 'PEhover',
            onUpdate: PESave,
        });
    }
}

and:

function PESave( cont ) {
    var str = Sortable.serialize(cont,{tag:'div'});
    new Ajax.Request('/tools/SavePageElements', {
        method: 'post',
        postBody: str,
        onComplete: function(xhr) {
            xhr = null;
        }
    });
}

1. Sortable triggers onUpdate twice if I drag an element between to
containers, and not just reorder by moving within the same container.
One onUpdate for each container that is.

2. Two requests is being sent to the server. If a user moves another
element, those 2 requests is being stalled (looking at it with
Fiddler), making IE unresponsive to further requests without closing
the window. The IE GUI works, its just the go-to-link-thing that's
dead.

The problem however is that IE chokes after 2-3 connections, and IE
has afaik a max outgoing connection limit of 2 default. But it should
just stack them and continue whenever theres a new connection-slot
available.

So anyone of you who has any experience of this? I canät show you any
live code right now since the application isn't publicly available. I
might be able to make a test case, but I'd rather not coz of
time-issues =)

btw: The onComplete-eventhandler for the Ajax.Request sets the xhr to
null as a desperate attempt to fix this =)

of course no problems whatsoever in saf/moz/ff/op etc.

Many thanks in advance,
Glenn Nilsson
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to