Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2010
    Thanked 2 Times in 2 Posts

    Loading new content via Ajax

    JS Fiddle: Edit fiddle - JSFiddle

    I've been doing extensive work on this and I've just able almost got it fully working. The reason why I am asking for help now is that I don't have a clue why my newly added accordion(s) do not expand upon being clicked.

    I've got a feeling it may be due to the newly added code as I was having problems using my code in the file so instead I looked at the source and copied the accordion level to be used and all appears to look fine apart from them not expanding.

    I've been told that this does not work because it does not exist upon the sortable code initializing and therefore I need to use Ajax, however I haven't a clue how to do this using Ajax and kindly ask for some help in doing so.

    Thank you for any help in advanced,

    Best Regards, Tim

  2. #2
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Jakarta, Indonesia.
    Thanked 78 Times in 76 Posts
    Hello Tim.
    I don't know the reason, but it looks like jQuery UI's accordion hasn't been able in "cloning" event-handlers to the new elements.

    There's a method called .refresh() in accordion, which (according to its doc.) should solve this, but sadly it doesn't. So I played a a little longer with your fiddle, and added 2 lines to this event-handler of yours:
    $(AddButton).click() //on add input button click
    as follows:
    1. to the very start, just destroy accordion first ...with this:
    2. then right before returning false, add this:



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts