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

Set visible of row doesn't work correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.3
    • Fix Version/s: 6.5.4
    • Component/s: Components
    • Labels:
      None

      Description

      <zk>
      	<label multiline="true">
      	1.select on listbox, you will see the grid shows only one row as same as your selection
      	2.click add to add more new items.
      	3.select on the new item of the listbox, the new added item doesn't show on grid
      	</label>
      	<window title="CHT1" border="normal" hflex="1" vflex="1">
      	<zscript><![CDATA[
                    
      		ListModelList model1 = new ListModelList();
      		model1.add("A");
      		model1.add("B");
      		model1.add("C");
      		ListModelList model2 = new ListModelList();
      		model2.add("A");
      		model2.add("B");
      		model2.add("C");
      		
      		void doSelect(int index){
      			List children = grid1.getRows().getChildren(); 
      			for(int i=0;i<children.size();i++){
      				children.get(i).setVisible(i==index?true:false);
      			}
      		}
      		void doAdd(){
      			String str = ""+new Date(); 
      			model1.add(str);
      			model2.add(str);
      		}
      	]]></zscript>
      		<button label="add" onClick="doAdd()"/>
      		<listbox id="listbox1" model="${model1}" onSelect="doSelect(listbox1.getSelectedIndex())"></listbox>
      		<grid id="grid1" model="${model2}">
      			<template name="model">
      				<row visible="false">
      					<label value="${each}"></label>
      				</row>
      			</template>
      		</grid>
      		
      	</window>
      </zk>
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: