-
7 Sep 2012 7:34 AM #1
XTemplate for inserting table rows into a tbody only inserts a single row in IE
XTemplate for inserting table rows into a tbody only inserts a single row in IE
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.0
- IE8
- IE9
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- When a XTemplate is used to generate a list of tr elements to be attached to a tbody the result in IE is only a single row. The first tr element from the list is missing and any element beyond the 2nd in the list are not included.
- Just take a look at the fiddle provided. It clearly shows the issue when run in IE.
Debugging already done:- The problem stems from the ieTable function in Ext.dom.Helper. Find my override in the next section. Here is the original code:
Possible fix:Code:ieTable: function(depth, openingTags, htmlContent, closingTags){ detachedDiv.innerHTML = [openingTags, htmlContent, closingTags].join(''); var i = -1, el = detachedDiv, ns; while (++i < depth) { el = el.firstChild; } // If the result is multiple siblings, then encapsulate them into one fragment. ns = el.nextSibling; if (ns) { // !!! The reference to the first child is lost here when el is over-written. !!! el = document.createDocumentFragment(); while (ns) { // !!! After you append ns to the el then it no longer has the nextSibling it did prior to the append. !!! el.appendChild(ns); ns = ns.nextSibling; } } return el; },- Override I used to fix the problem:
Operating System:Code:Ext.dom.Helper.override({ ieTable: function(depth, openingTags, htmlContent, closingTags){ var detachedDiv = document.createElement('div'); detachedDiv.innerHTML = [openingTags, htmlContent, closingTags].join(''); var i = -1, el = detachedDiv, ns; while (++i < depth) { el = el.firstChild; } // If the result is multiple siblings, then encapsulate them into one fragment. ns = el.nextSibling; if (ns) { var tmp = el; el = document.createDocumentFragment(); el.appendChild(tmp); while (ns) { tmp = ns.nextSibling; el.appendChild(ns); ns = tmp; } } return el; } });- OSX ML
-
7 Sep 2012 11:01 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Thanks for the report! I have opened a bug in our bug tracker.
You found a bug! We've classified it as
EXTJSIV-7194
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote