Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • pat 124 posts 346 karma points
    Dec 07, 2017 @ 13:00
    pat
    0

    buttons in partial render inside a partial does not work

    Hi all, I have a surfaceController and a partial view. I am listing few records with edit button on click edit button usng $.ajax GET I am loading another partial view into a div in the Current View.

    This load my new partial view successfully but when I click button on new view it just reload the second with without page layout. on button click I am calling a ajax Post to update date and return a Json string

    I have seen posts saying click event is not registered in second view so i have added click event on document ready function.

  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Dec 07, 2017 @ 13:04
    Paul Seal
    0

    Hi

    Are you using:

    $(document).on('click', function() {
     //blah
    });
    
  • pat 124 posts 346 karma points
    Dec 07, 2017 @ 13:15
    pat
    0

    Paul I have enter more details in new post please look at this https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/89611-buttons-in-partial-render-inside-a-partial-does-not-work

    i have added line like below , is it worng

    $('#updatebtn').on('click' , function(e){
    
  • pat 124 posts 346 karma points
    Dec 07, 2017 @ 13:32
    pat
    0

    Paul I have noticed that even though new edit partial view render to page it does not refresh page code in debug mode.... i cannot see html in elements .... this look so wrong...

  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Dec 07, 2017 @ 14:23
    Paul Seal
    0

    Yes I would say it is wrong because it won't be bound if it came in with the ajax result. You want something like this:

    $(document).on('click', '#updatebtn', function(e){
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies