Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not move as at top or bottom already #2

Open
kbaum opened this issue Nov 23, 2011 · 6 comments
Open

Could not move as at top or bottom already #2

kbaum opened this issue Nov 23, 2011 · 6 comments

Comments

@kbaum
Copy link

kbaum commented Nov 23, 2011

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:

<div id="spaces" class="ui-sortable">

  <div id="tour_book_space_1" class="tour_book_space space_14" style="opacity: 1;">
    <div class="image"><img src="/uploads/space/photo/14/property_listing_585049235001_1007635203001_vs-1007437921001.jpg" alt="Property_listing_585049235001_1007635203001_vs-1007437921001" style="c
    <div class="title">5 Rigney Terrace </div>
    <div class="comment-link"> 
      <div class="input text optional" style="display: none;"><label for="tour_book_tour_book_spaces_attributes_0_comment" class="text optional"> Comment</label><textarea rows="20" name="tour_book[t
      <a href="#">comment</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'  });
@mattheworiordan
Copy link
Owner

Hi Kbaum

I'd really need the entire HTML & CSS to test this, as the divs without styling will not be draggable. Can you provide a complete working example?

Matt

@kbaum
Copy link
Author

kbaum commented Nov 25, 2011

Hi Matt. I have an example as a zip. Not sure of the best way to get you it. Can you message me privately on github and we can work out the details offline?

thx!

@mattheworiordan
Copy link
Owner

Done, emailed you privately.

@omeraslam-vteams
Copy link

hi i am having the same issue where i have the li list and have to drag and drop it says warning: Could not move as at top or bottom already

@staeff
Copy link

staeff commented Oct 19, 2015

@mattheworiordan I find the same error/problem. Any hints how it has been solved?

@mattheworiordan
Copy link
Owner

Sorry, I don't have time to support this anymore :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants