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

The nav items size is not adapted in case further items are added on demand

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 7.0.6
    • 7.0.4
    • Components
    • Security Level: Jimmy
    • ZK 7.0.7

      We do use the navbar component to display some kind of tree model.
      Because we do not have a concrete finite tree depth, we cannot add all navitems on startup.
      Instead we do use the "onOpen"-Event to add additional items.
      Now, if the label of the item is to large for the initially calculated size of the navbar popup, the label is not shown at all.
      (See screenshot attached.)

      This behavior is also reproducible an the current 7.0.5 nightly version.

      Reproducible sample:

      <zk>
      	<label multiline="true">
      	1. Hover on question icon, should see nav popup showed.
      	2. Click on "Nav 2", the newly added item didn't showed.
      	</label>
      	<zscript>
      	void addItem(boolean open, Nav nav) {
      		if (open) {
      			Navitem item = new Navitem();
      			item.setLabel("Looooooooooooooooooooong label");
      			item.setIconSclass("z-icon-circle");
      			nav.appendChild(item);
      		}
      	}
      	</zscript>
      	<borderlayout>
      		<north>North</north>
      		<west>
      			<navbar orient="vertical" width="45px" collapsed="true">
      				<nav iconSclass="z-icon-question-circle" label="Nav 1">
      					<navitem label="Navitem" iconSclass="z-icon-times" />
      					<nav iconSclass="z-icon-question-circle" label="Nav 2" onOpen="addItem(event.isOpen(), self)"></nav>
      				</nav>
      				<navitem label="Navitem" iconSclass="z-icon-times" />
      				<navitem label="Navitem" iconSclass="z-icon-times" />
      				<navitem label="Navitem" iconSclass="z-icon-times" />
      			</navbar>
      		</west>
      		<center>
      			<div>
      				Center
      			</div>
      		</center>
      	</borderlayout>
      </zk>
      

            ChunfuChang ChunfuChang
            jach jach
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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