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

Invisible window inside vbox cause js error when calculating flex size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.6, 7.0.2
    • 6.5.5
    • Components
    • Security Level: Jimmy

      <zk>
      	<label multiline="true">
      	Click "Upload" button, should not see any JS error.
      	</label>
      	<vbox hflex="1">
      		<button label="Upload" onClick="vbox1.setVisible(true);" />
      		<vbox hflex="1" id="vbox1" visible="false"></vbox>
      		<window title="window" visible="false" border="normal">
      			Window
      		</window>
      	</vbox>
      </zk>
      

      Possible workaround:

      <script type="text/javascript"><![CDATA[
      zk.afterLoad('zul.box', function() {
      	var _xBox = {};
      	zk.override(zul.box.Box.prototype, _xBox, {
      		afterResetChildSize_: function () {
      			for (var kid = this.firstChild, vert = this.isVertical(); kid; kid = kid.nextSibling) {
      				if (kid.desktop) { //kid may not bind to desktop yet (client rod enabled)
      					var chdex = vert  ? kid.$n('chdex').firstChild : kid.$n('chdex');
      					if (chdex)
      						chdex.style.minWidth = '1px';
      				}
      			}
      		}
      	});
      });
      ]]></script>
      

            noahhuang noahhuang
            vincentjian vincentjian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: