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

all columns hidden become visible in chrome

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 8.0.5, 8.5.2.1, 8.6.0.1
    • Components
    • Security Level: Jimmy
    • None
    • Chrome

      Steps to Reproduce

      <zk>
      	<grid>
      		<columns>
      			<column id="col1" width="200px" label="col-1"/>
      			<column id="col2" width="200px" label="col-2"/>
      		</columns>
      		<rows>
      			<row><label value="row 1-1"/><label value="row 1-2"/></row>
      			<row><label value="row 2-1"/><label value="row 2-2"/></row>
      			<row><label value="row 3-1"/><label value="row 3-2"/></row>
      		</rows>
      	</grid>
      	<toolbarbutton mode="toggle" checked="true" onClick="col1.setVisible(!col1.visible)" label="toggle col-1"/>
      	<toolbarbutton mode="toggle" checked="true" onClick="col2.setVisible(!col2.visible)" label="toggle col-2"/>
      </zk>
      

      click both buttons hide all columns

      Current Result

      when all columns are hidden they become visible again in Chrome

      Expected Result

      hidden columns remain hidden (e.g. as in FF)

      Debug Info

      Root Cause

      Workaround

      	zk.afterLoad('zul.mesh', function() {
      		var xMeshWidget = {};
      		zk.override(zul.mesh.MeshWidget.prototype, xMeshWidget, {
      			_afterCalcSize : function() {
      				var result = xMeshWidget._afterCalcSize.apply(this, arguments);
      
      				if(this._isAllWidths()) {
      					var allHeadersHidden = true;
      					for(var header = this.head.firstChild; header; header = header.nextSibling) {
      						if(header.isVisible()) {
      							allHeadersHidden = false;
      							break;
      						}
      					}
      					if(allHeadersHidden) {
      						if (this.eheadtbl) { this.eheadtbl.style.width = '0px'; }
      						if (this.ebodytbl) { this.ebodytbl.style.width = '0px'; }
      						if (this.efoottbl) { this.efoottbl.style.width = '0px'; }
      					}
      				}
      				return result;
      			}
      		});//zk.override
      	});//zk.afterLoad
      

            CharlesQiu CharlesQiu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h