Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3696

Grid doesn't render more than 3 Auxhead components

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.5, 8.0.5
    • Fix Version/s: 8.5.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      1. 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
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rudyhuang rudyhuang
              Reporter:
              hawk hawk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 30 minutes
                  2h 30m