2 Replies - 773 Views - Last Post: 08 April 2015 - 12:51 PM

#1 strident.silence   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-November 13

Draggable, sortable click event

Posted 08 April 2015 - 11:45 AM

Hi,

I have two lists, one sortable and one draggable. I drag some <li> from one list to the other using
connectToSortable (cloned). This is working correctly. However, I have an anchor contained in the <li> which
doing this:
        $(".detailsSequence").on('click', function(){
            $(this).parent().find('.sequenceApp').each(function(){
                $(this).toggle();
            });
        });



Anchors look like this

<a id="@Html.DisplayFor(model => model.RolesMdt.ElementAt(i).Key)" class="detailsSequence" href="#">?</a>




The event works in the draggable list, but when I transfert it to the other, it doesn't.
I did inspect the page and the anchor still is of class "detailsSequence". What am I missing?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Draggable, sortable click event

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3134
  • View blog
  • Posts: 8,931
  • Joined: 15-January 14

Re: Draggable, sortable click event

Posted 08 April 2015 - 11:59 AM

Cloning an element does not also copy the events, you'll have to set up the events on the cloned elements again.
Was This Post Helpful? 0
  • +
  • -

#3 strident.silence   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-November 13

Re: Draggable, sortable click event

Posted 08 April 2015 - 12:51 PM

Yup I had to rebind the event. Thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1