-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.0, 8.5.2
-
None
-
Security Level: Jimmy
-
None
-
ZK 8.6.0 S1
-
None
Steps to Reproduce
Run fiddle:
http://zkfiddle.org/sample/1jj3lt0/1-zk-header-column-missing-cell
Current Result
Two cells are hidden in the content
Expected Result
only the first cell should be hidden in the content
Debug Info
Cell h1 is not visible due to receiving displayLnone;
This also cause this cell to not be counted by the browser when calculating cell / column position.
The bdfaker <col> element for the 1st column only receives width:0.1px. This makes the col element non-visible, but still counting toward calculating cell / column position:
no column <> cell 1 (skipped due to display none)
col 1 (did not received display:none, with a width of 0.1px) <> cell 2 (visible but with a width of 0.1px received from column)
col 2 <> cell 3
col 3 <> cell 4
Root Cause
Workaround
8.5.1.2
<script><![CDATA[ zk.afterLoad('zul.mesh', function() { var xMeshWidget = {}; zk.override(zul.mesh.MeshWidget.prototype, xMeshWidget ,{ domFaker_: function (out, fakeId) { //used by redraw var head = this.head; out.push('<colgroup id="', head.uuid, fakeId, '">'); for (var w = head.firstChild; w; w = w.nextSibling) { var wd = w._hflexWidth ? w._hflexWidth + 'px' : w.getWidth(), visible = !w.isVisible() ? 'width : 0.1px' : ''; // B70-ZK-2036: Style width should end with 'px'. wd = wd ? 'width: ' + wd + ';' : ''; vis = w.isVisible()?"":"display:none;"; out.push('<col id="', w.uuid, fakeId, '" style="', wd, vis, visible, '"/>'); } if (!this.frozen && (fakeId.indexOf('hd') > 0 || fakeId.indexOf('ft') > 0)) out.push('<col id="', head.uuid, fakeId, '-bar" style="width: 0px" />'); out.push('</colgroup>'); } });//zk.override });//zk.afterLoad ]]></script>
8.5.2 FL
<script><![CDATA[ zk.afterLoad('zul.mesh', function() { var xMeshWidget = {}; zk.override(zul.mesh.MeshWidget.prototype, xMeshWidget ,{ domFaker_: function (out, fakeId) { //used by redraw var head = this.head; out.push('<colgroup id="', head.uuid, fakeId, '">'); for (var w = head.firstChild; w; w = w.nextSibling) { var wd = this.$class._getWidth(w, w._hflexWidth ? w._hflexWidth + 'px' : w.getWidth()), // B70-ZK-2036: Style width should end with 'px'. wd = wd ? 'width: ' + wd + ';' : ''; vis = w.isVisible()?"":"display:none;"; out.push('<col id="', w.uuid, fakeId, '" style="', wd, vis, '"/>'); } if (fakeId.indexOf('hd') > 0 || fakeId.indexOf('ft') > 0) out.push('<col id="', head.uuid, fakeId, '-bar" style="width: 0px;" />'); out.push('</colgroup>'); } });//zk.override });//zk.afterLoad ]]></script>