attach.insertAdjacentElement('AfterEnd', newRow); does not work

Fixed Issue #9223229

Details

Author
Sharad g.
Created
Oct 6, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

We are trying to insert a row using EDGE browser in our table. The function does not add a row in my HTML Collection. When I switch back to IE 8 standards mode the code starts working without having any issue.

Here is the code snippet.

console.log(“app/tree.js tree_branch_open_response called…” + response);
// have received the branches to add to the tree
var start = response.indexOf(“breadcrumb=”);
var end = response.indexOf(";", start);
var breadcrumb = response.substring(start + 11, end);
console.log(“start…” + start + “…end…” + end + “…breadcrumb…” + breadcrumb);
try {
//get the 1st rows id since this is the default we don’t want this to be overridden
var firstRowId = currentTree.rows(0).id;
console.log(“firstRowId…” + firstRowId);

    var treeCurrentRow = currentTree.ownerDocument.getElementById("tr:" + breadcrumb);
    treeCurrentRow.setAttribute("name", "close");   

    var currentRowIdx = currentTree.rows.length;
    if (breadcrumb != "") {  // used for the Other Carriers Folder
        currentRowIdx = treeCurrentRow.rowIndex + 1;
    }

    var idx = response.indexOf("tr:");      
    if (idx != -1){
        tree_checkOpenNodesBelowThreshold(currentTree);         
    }
    
    var scratch;    
    if (calledFromPopup){
        scratch = currentTree
    }else{
        scratch = document.getElementById("scratch-pad");
    }   
    var attach = treeCurrentRow;
    console.log("scratch..." + scratch + "..attach. " + attach);
    var idx = response.indexOf("tr:");  
    while (idx != -1) {
        var idxEnd = response.indexOf(";", idx + 1);        
        var currentId = response.substring(idx,idxEnd);
        console.log("idxEnd..." + idxEnd + "..currentId. " + currentId);
        if (currentId != firstRowId && currentTree.ownerDocument.getElementById(currentId) == null) {
            var newRow = tree_createRow(scratch, currentId, response, idx);
            debugger;
            //console.log("tree length..1.." + currentTree.rows.length);
            attach.insertAdjacentElement('AfterEnd', newRow);   
            //console.log("tree length...2.." + currentTree.rows.length);
            //attach.insertAdjacentHTML('AfterEnd', newRow);    
            //attach.parentNode.insertBefore(newRow, attach.nextSibling);
            //attach.appendChild(newRow);
            //var top = currentTree.offsetTop;
            //var attachtop = attach.offsetTop;
            //var newRowTop = newRow.offsetTop;
            console.log("tree length...3.." + currentTree.rows.length);
            
            attach = newRow;
            console.log("newRow..." + newRow);
            currentRowIdx++;
        }   
        idx = response.indexOf("tr:", idxEnd);
    }

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Title from “attach.insertAdjacentElement('AfterEnd', newRow); does not work” to “attach.insertAdjacentElement('AfterEnd', newRow); does not work”

  • Please further note that the issue does not appear with Windows 10 but appears with Windows 7

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

  • I tried to reproduce the issue by creating simple html but not able to reproduce.

    insertAdjacentElement

    List Item 1
    
    List Item 2
    
    List Item 3
    
    
    
    
    
    
    
        1
    
        2
    
        3
    
        4
    
        5
    
        6
    
        7
    
        8
    
        9
    
        10
  • Please find attach test.html where I tried to reproduce the error but unable to reproduce it.

  • any update on this

  • Microsoft Edge Team

    Changed Assigned To to “Leo L.”

    Changed Assigned To to “Travis L.”

    Changed Status to “Confirmed”

  • I just saw the status is CONFIRMED. What is the meaning of CONFIRM means? Could you please clarify.

  • Failing Scenario (Window 7/Windows 8.1 IE11 with IE11/EDGE Document Mode):
    It fails in the above environment.
    I have uploaded two fiddler file.
    Repro1.saz fiddler file will help you to reproduce the error
    Working1.saz fiddler works fine.

    Working Scenario (Window 10 IE11 with IE11/EDGE Document Mode): After the
    It works fine in the above environment.

  • Microsoft Edge Team

    Changed Status from “Confirmed” to “Fixed”

You need to sign in to your Microsoft account to add a comment.

Sign in