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

hiding the first column causes inconsitent column widths

    XMLWordPrintable

    Details

      Description

      Steps to Reproduce

      run the attachment hide-first-column.zul
      hide the first column using the column menu

      Actual Result

      the listcells become hidden as expected
      the hidden listheader remains visible but empty

      Expected Result

      both cells and headers should disapear, and the visible headers/cells should align horizontally

      Debug Info

      similar problem happens when hiding another column
      this likely also happens for grid/tree

      Workaround

      1) use fixed or hflex width
      OR
      2) apply the following JS override to set the hidden columns header widths to 0:

      zk.afterLoad('zul.mesh', function() {
      	var xMeshWidget = {};
      	zk.override(zul.mesh.MeshWidget.prototype, xMeshWidget, {
      		_calcMinWds : function() {
      			var result = xMeshWidget._calcMinWds.apply(this, arguments);//call original method
      			var zHead = this.getHeadWidget();
      			if(zHead) {
      				for(var colIndex = 0; colIndex < zHead.nChildren; colIndex++) {
      					if(!zHead.getChildAt(colIndex).isVisible()) {
      						result.wds[colIndex] = 0; //intended side effect to same array stored to this._minWd.wds (in original method)					
      					} 
      				}
      			}
      			return result;
      		}
      	});//zk.override
      });//zk.afterLoad
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              wenninghsu wenninghsu
              Reporter:
              cor3000 cor3000
              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 - 4 hours
                  4h