-
Bug
-
Resolution: Fixed
-
Normal
-
7.0.5, 8.0.5
-
None
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
- run the attached zul
Current Result
only 3 auxhead are rendered, but there are 4 auxhead. And it doesn't render <columns>, either.
Expected Result
Grid renders all <auxhead> and <columns>
Debug Info
- This issue happens since 7.0.5, but 7.0.4 doesn't have such issue
Root Cause
- it's caused by the fix for
ZK-2559 - The fix is logically incorrect. If childNode is undefined, we should not skip (by continue) the loop since there are other checkings below the statement. Continue the loop will skip those checkings.
Workaround
zk.afterLoad('zul.mesh', function() { var xMeshWidget = {}; zk.override(zul.mesh.MeshWidget.prototype, xMeshWidget, { _fixHeaders : function(force) { if (this.head && this.ehead) { var empty = true, flex = false, hdsmin = (this._hflex == 'min') || this.isSizedByContent(); for (var i = this.heads.length; i-- > 0;) { var header = this.heads[i], emptyHeader = true; for (var w = header.firstChild; w; w = w.nextSibling) { //B70-ZK-2559: when dynamic adding auxhead, there has already //been auxhead widget while dom element hasn't attached yet var childNode = this.ehdfaker.childNodes[i]; if (hdsmin && !childNode && !childNode.style.width && !w._nhflex) { //workaround // B50-3357475: assume header hflex min if width/hflex unspecified w._hflex = 'min'; w._nhflex = -65500; // min w._nhflexbak = true; } if (!flex && w._nhflex) flex = true; if (w.getLabel() || w.getImage() || w.nChildren) { emptyHeader = false; empty = false; } } if (header._visible) { //B70-ZK-2559: description as mentioned var n = header.$n(); if (n) n.style.display = emptyHeader ? 'none' : ''; // Bug ZK-2348 } } var old = this.ehead.style.display, tofix = force && flex && this.isRealVisible(); //Bug ZK-1647: no need to consider empty header for flex calculation this.ehead.style.display = empty ? 'none' : ''; //onSize is not fired to empty header when loading page, so we have to simulate it here for (var w = this.head.firstChild; w; w = w.nextSibling) { if (tofix && w._nhflex) w.fixFlex_(); if (w._nhflexbak) { delete w._hflex; delete w._nhflex; delete w._nhflexbak; } } return old != this.ehead.style.display; } } });//zk.override });//zk.afterLoad
- relates to
-
ZK-2559 adding auxheaders together with columns causes JS errors
- Closed