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

Wrong hflex calculation when header widgets are invisible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.8
    • 6.5.7
    • General
    • Security Level: Jimmy

      Reproducing steps:

      Load the following zul pages into the browser

      listbox.zul
      <listbox width="200px">
          <listhead visible="false">
              <listheader label="Listheader 1" hflex="1"/>
          </listhead>
          <listitem label="Listitem 1"/>
          <listitem label="Listitem 2"/>
          <listitem label="Listitem 3"/>
          <listitem label="Listitem 4"/>
          <listitem label="Listitem 5"/>
      </listbox>
      
      grid.zul
      <grid width="200px">
          <columns visible="false">
              <column label="Column Label" hflex="1"/>
          </columns>
          <rows>
              <row><cell>Cell 1</cell></row>
              <row><cell>Cell 2</cell></row>
              <row><cell>Cell 3</cell></row>
              <row><cell>Cell 4</cell></row>
              <row><cell>Cell 5</cell></row>
          </rows>
      </grid>
      
      tree.zul
      <tree width="200px">
          <treecols visible="false">
              <treecol label="Tree Column 1" hflex="1"/>
          </treecols>
          <treechildren>
              <treeitem label="Tree Node 1">
                  <treechildren>
                      <treeitem label="Tree Node 1.1" />
                      <treeitem label="Tree Node 1.2">
                          <treechildren>
                              <treeitem label="Tree Node 1.2.1"/>
                              <treeitem label="Tree Node 1.2.2"/>
                          </treechildren>
                      </treeitem>
                  </treechildren>
              </treeitem>
          </treechildren>
      </tree>
      

      Expected result:

      Header labels are hidden, and the only item in each row consumes the entire width of the table.

      Actual result:

      Header labels are hidden as expected. However, the only item in each row consumes just half of the table width.

      Workaround:

      Instead of setting visible to false, apply style="display:none" to the header components. For example,

      <listhead style="display:none"/>
      <columns style="display:none"/>
      <treecols style="display:none"/>
      

            hanhsu hanhsu
            neillee neillee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: