Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    390
    Thanks
    48
    Thanked 1 Time in 1 Post

    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
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    349
    Thanks
    9
    Thanked 51 Times in 50 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:
    Code:
    $(AddButton).click() //on add input button click
    as follows:
    1. to the very start, just destroy accordion first ...with this:
      Code:
      InputsWrapper.accordion('destroy');
    2. then right before returning false, add this:
      Code:
      create_accordian(InputsWrapper);


    Hendra


  •  

    Posting Permissions

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