locked
Rows added by ajax call dissapear from view source RRS feed

  • Question

  • User-1685971342 posted

    Hi All,

    I have a html table to display data. On double click of each row, I am adding child rows to the clicked row by using Ajax. But when I try to find the added rows in "ViewSource", those are missing. So the next ajax actions on those rows are not happening.

    below is my code

    $("#tblStructures tr").each(function () { $(this).hover(function () { $(this).css('cursor', 'hand'); }); $(this).dblclick(function () { var oThis = $(this); var sStructureID = $(this).children().eq(0).html(); var $url = $("#hdnGetFilterData").val() + "?StructureID=" + sStructureID; //alert('in' + $url); $.ajax({ url: $url, type: 'GET', data: null, success: function (response) { oThis.after(response); }, error: function (xhr, status) { } }); }); });
    The "response" contains rows with some data and anchor tags like below
     <a class='htmlLinkModalEditStrDet' href='/StructureMapping/GetStructureDetails?Mode=Edit&amp;OriginalID=" + lstStructureDetails[i].ORIGINAL_ID + "&amp;StructureID=" + lstStructureDetails[i].STRUCTURE_ID + "' title='Edit Structure Details'>Edit</a>
     But the data and this anchor tag is missing in the viewsource and probably that is the reason for which the ajax call attached to that "htmlLinkModalEditStrDet" is not happening.
    Please help, it's urgent
    Tuesday, August 23, 2011 9:12 AM

Answers

  • User401360897 posted

    So the next ajax actions on those rows are not happening.

    use Jquery live or delegate

    http://www.alfajango.com/blog/the-difference-between-jquerys-bind-live-and-delegate/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 25, 2011 2:23 AM