title: JQuery - How to Conditionally Remove list item from Sortable Target
body: <p>I want to drag an item from one list to another and delete an item from the target if there are any blank items, so the list stays the same size.</p>
  <p>I can delete an item if the next item is blank, but how to find if there are any blank items and delete the next one.</p>
  <p>ie    <code>ui.item.next('isblankrung').remove();</code></p>
  <p>I can get the text of the dragged item, but the id is undefined.</p>
  <pre class="lang-js prettyprint-override"><code>    $('#ladderList').sortable({
          connectWith: '#teamsList, #ladderList',
          items: '.draggable-item, .sortable-item',
          start: function (event, ui) {
              $('#teamsList').sortable('enable');
          },
          receive: function (event, ui) {
          if (ui.item.hasClass('ui-draggable')) {
                  // destroy draggable so that we can drag outside the sortable container
                  ui.item.draggable(&quot;destroy&quot;);
              }
          },
          stop: function (event, ui) {
              if (ui.item.hasClass('isteam')) {
              alert(ui.item.id);
              alert(ui.item.text());
                  ui.item.removeClass('isteam').addClass('isteamrung');
                  ui.item.removeClass('draggable-item').addClass('sortable-item');
                  if (ui.item.next().hasClass('isblankrung')) {
                      alert(ui.item.text());
                      ui.item.next().remove();
                  }
              }
          }
          });
  </code></pre>