Results 1 to 3 of 3

Thread: [CLOSED][3.2.1] Ext.Element -> createChild

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Vote Rating
    129
      0  

    Default [CLOSED][3.2.1] Ext.Element -> createChild

    hi team,

    this bug only occurs in chrome, in IE 8 and ff 3.6 this code works fine:

    Code:
    Ext.onReady(function(){
    	new Ext.Button({
    		renderTo: document.body,
    		text:'Hello World',
    		listeners : {
    			afterrender : function(btn){
    				btn.getEl().createChild({
    					tag: 'div',
    					id: 'btnChild'
    				});
    			}
    		}
    	});
    });
    the chrome console says:
    Uncaught TypeError: Cannot read property 'nextSibling' of null
    refering to the ieTable-function of Ext.DomHelper:

    Code:
        function ieTable(depth, s, h, e){
            tempTableEl.innerHTML = [s, h, e].join('');
            var i = -1,
                el = tempTableEl,
                ns;
            while(++i < depth){
                el = el.firstChild;
            }
    
    //  here is the point chrome breaks, it seems that el == null
            if(ns = el.nextSibling){
                var df = document.createDocumentFragment();
                while(el){
                    ns = el.nextSibling;
                    df.appendChild(el);
                    el = ns;
                }
                el = df;
            }
            return el;
        }
    i think that including

    Code:
     if(el && ns = el.nextSibling){
    will do the trick but i have no idea how to change that method inside the DomHelper-singleton.


    kind regards,
    tobiu
    Best regards
    Tobias Uhlig

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,064
    Vote Rating
    962
      0  

    Default

    Should that really work?

    You're adding a div as a child to a table element. It's probably more good luck than anything else that it works.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Vote Rating
    129
      0  

    Default

    hi even,

    well, this makes sense. only tbody and tr-tags should be children of a table.

    i found this one in Ext.ux.SwfUploadPanel, a non official ux.

    so, i think the best way to go is to debug that ux

    feel free to close this report.

    well, i already spent some time to check, what happens inside the domHelper, so maybe it helps someone else to see why chrome acts differently:

    firefox calls
    createdChild -> doInsert -> insertHTML

    chrome calls:
    createChild -> doInsert -> insertHTML -> insertIntoTable -> ieTable

    so, the problem was in insertHTML, not ieTable:
    there is a check:

    Code:
    if (el.insertAdjacentHTML)
    returning true in chrome, false in other browsers.


    kind regards and thanks for the table -> tr hint =)
    tobiu
    Best regards
    Tobias Uhlig

Similar Threads

  1. Replies: 6
    Last Post: 18 Jul 2009, 12:30 PM
  2. Replies: 4
    Last Post: 15 Jun 2009, 4:58 AM
  3. problem Ext.Element.createChild
    By chunkT in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 22 Jan 2009, 7:53 AM
  4. [2.0.2][CLOSED] createChild Possible IE Bug?
    By kouphax in forum Ext 2.x: Bugs
    Replies: 2
    Last Post: 28 Mar 2008, 7:05 AM

Posting Permissions

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