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

Hlayout/Vlayout performance issue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.9, 6.0.0
    • 5.0.8
    • Components
    • None

      Hlayout/Vlayout shall use fireDown() rather then fire() in syncSize()

      Test case:

      <zk>
      	<zscript><![CDATA[
      		import java.util.ArrayList;
      		ArrayList productList = new ArrayList();
      		ListModelList listModel = new ListModelList();
      		int i = 0;
      		while (i < 5) {
      			String p = new String("name" + i++);
      			productList.add(p);
      		}
      		listModel.addAll(productList);
      		RowRenderer render = new RowRenderer() {
      			public void render(Row row, Object data) throws Exception {
      				String p = (String) data;
      				
      				Hlayout l = new Hlayout();
      				l.appendChild(new Label("Label"));
      				l.setParent(row);
      				
      				Div div = new Div();
      				div.setHflex("1");
      				div.setParent(row);
      			}
      		};
      		void setProdListModel(int amount) {
      			int i = 0;
      			productList.clear();
      			listModel.clear();
      			while (i < amount) {
      				String p = new String("name" + i++);
      				productList.add(p);
      			}
      			listModel.addAll(productList);
      		}
      	]]></zscript>
      	<window title="new page title" border="normal">
      		ListModelList Size:
      		<intbox id="modelSize" value="50" />
      		<button label="change" id="button">
      			<attribute name="onClick">
      				setProdListModel(modelSize.getValue());
      				grdProductProductions.setModel(listModel);
      			</attribute>
      		</button>
      		<grid width="100%" id="grdProductProductions"
      			model="${listModel}" rowRenderer="${render}">
      			<columns sizable="true">
      				<column label="total" align="left" />
      				<column label="obver" align="center" />
      			</columns>
      		</grid>
      	</window>
      </zk>
      

            SimonPai SimonPai
            SimonPai SimonPai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: