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

client side Widget.hide() does not recalculate flex (while Widget.hide() does)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.1
    • Fix Version/s: 7.0.2
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      in the example the left_part and right_part use hflex="1", when making the right part visible the widths of left and right are recalculated OK
      when making the right_part invisible again the left part remains at the same size
      -> show() and hide() behave differently, this is not intuitive and unexpected

      <zk xmlns:w="client">
      
      	<hlayout width="1024px" id="parent" style="border: 1px solid red">
      		<vlayout hflex="1" id="left_part" style="border: 1px solid green">left part - flex1</vlayout>
      		<div hflex="1" id="right_part" style="border: 1px solid blue" visible="false">right part - flex1</div>
      	</hlayout>
      
      	<button label="toggle right_part visibility" w:onClick="
      		var rightPart = this.$f('right_part');
      		if (rightPart.isVisible()) {
      			rightPart.hide(); 
      			/*zUtl.fireSized(this.$f('parent'), true);*/ /*workaround to recalc flex */
      		} else { 
      			rightPart.show();
      		}"/>
      </zk>
      

        Attachments

          Activity

            People

            • Assignee:
              jumperchen jumperchen
              Reporter:
              cor3000 cor3000
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: