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

Calling tree.selectAll() doesn't select all items on a browser

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.1
    • 8.0.0
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.0.1 S2
    • None

      Steps to reproduce

      1. load the zul
        <zk>
        	<tree id="tree" rows="5" multiple="true" checkmark="true">
        		<treecols>
        			<treecol>
                                	<checkbox label="Name"
        				style="font-weight: bold;" id="selectAllCheckbox"
        				onCheck="if(self.checked) tree.selectAll(); else tree.clearSelection();" />
                          </treecol>
        			<treecol label="Description"/>
        		</treecols>
        		<treechildren>
        			<treeitem>
        				<treerow>
        					<treecell label="Item 1"/>
        					<treecell label="Item 1 description"/>
        				</treerow>
        			</treeitem>
        			<treeitem  checkable="false" open="false">
        				<treerow>
        					<treecell label="Item 2"/>
        					<treecell label="Item 2 description"/>
        				</treerow>
        				<treechildren>
        					<treeitem>
        						<treerow>
        							<treecell label="Item 2.1"/>
        						</treerow>
        						<treechildren>
        							<treeitem>
        								<treerow>
        									<treecell label="Item 2.1.1"/>
        								</treerow>
        							</treeitem>
        							<treeitem>
        								<treerow>
        									<treecell label="Item 2.1.2"/>
        								</treerow>
        							</treeitem>
        						</treechildren>
        					</treeitem>
        					<treeitem>
        						<treerow>
        							<treecell label="Item 2.2"/>
        							<treecell label="Item 2.2 is something who cares"/>
        						</treerow>
        					</treeitem>
        				</treechildren>
        			</treeitem>
        		</treechildren>
        	</tree>
        </zk>
        

        http://zkfiddle.org/sample/3m5r5vt/2-Tree-selectAll-not-working

      Workaround

                      for (Treeitem item: tree.getItems()){
      			if (item.isCheckable()){
      				tree.toggleItemSelection(item);
      			}
      		}
      

            wenninghsu wenninghsu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d