View Single Post
  #4  
Old 03-20-2012, 01:36 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 32,886
fadillzzz is an unknown quantity at this point
Default

You can add a callback to the receive event and prevent users from putting more than 2 items into the same area. But this might prevent them from sorting if there's no empty space. And if they only have one empty space, it'll probably be a little bit painful to reorder the adoptables

HTML Code:
$('.sortable_adoptables')
                    .css('background-color', '#FFFF66')
                    .animate({ backgroundColor: realBg },  'slow' )
                    .sortable({ 
                        cursor: 'pointer', connectWith: ".sortable_adoptables", receive: function(event, ui) {
                            var $this = $(this);
                            if ($this.children('table').length > 1) {
                                $(ui.sender).sortable('cancel');
                            }
                        }
                    });
Reply With Quote