mattheworiordan/jquery.simulate.drag-sortable.js — Issue #2: Could not move as at top or bottom already
Author: kbaum
Created: 2011-11-23 01:48:06+00:00
State: open

Trying to simulate the resorting but i keep getting the error:

Could not move as at top or bottom already

My sortable jquery looks like:

$('div#tour-book-form #spaces').sortable({ opacity: 0.6, items: 'div.tour_book_space', update: function() {
$.ajax({
type: "POST",
url: '/tour_book_spaces/position?' + $(this).sortable('serialize'),
data: { _method: 'PUT'}
});
}
});

And my list looks like:

5 Rigney Terrace

Commentcomment</a>
</div>
</div><input type="hidden" value="1" name="tour_book[tour_book_spaces_attributes][0][id]" id="tour_book_tour_book_spaces_attributes_0_id">
<div id="tour_book_space_2" class="tour_book_space space_15" style="opacity: 1;">
<div class="image"><img src="/uploads/space/photo/15/property_listing_arc-113-1308536831455.jpg" alt="Property_listing_arc-113-1308536831455" style="cursor: move;"></div>
<div class="title">87068 Muir Crossing </div>
<div class="comment-link">
<div class="input text optional" style="display: none;"><label for="tour_book_tour_book_spaces_attributes_1_comment" class="text optional"> Comment</label><textarea rows="20" name="tour_book[t
<a href="#">comment</a>
</div>
</div><input type="hidden" value="2" name="tour_book[tour_book_spaces_attributes][1][id]" id="tour_book_tour_book_spaces_attributes_1_id">
<div id="tour_book_space_3" class="tour_book_space space_16">
<div class="image"><img src="/uploads/space/photo/16/property_listing_arc-113-1308537045281.jpg" alt="Property_listing_arc-113-1308537045281" style="cursor: move;"></div>
<div class="title">649 Surrey Terrace </div>
<div class="comment-link">
<div class="input text optional" style="display: none;"><label for="tour_book_tour_book_spaces_attributes_2_comment" class="text optional"> Comment</label><textarea rows="20" name="tour_book[t
<a href="#">comment</a>
</div>
</div>

I execute:

$('#tour_book_space_2').simulateDragSortable({ move: 1, listItem: 'div.tour_book_space' });