Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jquery sortable question

 
Ernesto Leyva
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

I implemented the jquery sortable plugin to be able drag and drop list-items between two lists. I apply some styles to my list items like putting different background for each list. the issue is when I drag one item from list A to list B most of the time I see the dragged elements but every now and then when i start dragging the element disappear from the screen I can still drag it but I cannot see it and suddenly appears again when I drop it. The only i am able to see in those cases is the mouse pointer.

here is my code:

Note: the switched var tells me if the item changed from list A to B or vice versa!
Note2: in the same page I load EXTJS and jQuery but I am not triggering EXTJS events when dragging and the list items are plain
  • elements

    var switched, senderID;
    $CQ('#sni-selection .sni-selection-list').sortable({
    connectWith:'.sni-selection-list',
    start:function(e, ui){

    switched = false;
    senderID = '';
    },

    stop:function(e, ui){

    if (switched){

    so.selection.move(ui, senderID);
    }else{

    so.selection.drag(ui);
    }
    },
    receive:function(e, ui){

    senderID = ui.sender[0].id;
    switched=true;
    }

    });

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic