Jquery UI Sortable – Get the item being sorted


  var myTray =  $(".tray").sortable({
           connectWith: ".connectedSortable ",
           helper: "clone",
           activeClass: "ui-state-default",
           hoverClass: "ui-state-hover",
           stop: function(e, ui)  {
			   ui.item.html('abc');     //<--
			   console.log("a1");
				
           }
       });
  var setTileDraggable = function(tileSelector) {
           tileSelector.draggable({
               connectToSortable: myTray,
               containment: gameContainer,
               helper: "clone",  
               revert: "invalid"
           }); 
       };

       setTileDraggable($(".potile"));

Screen Shot 2015-08-23 at 3.42.28 PM

,

Leave a Reply