# How to set checked of checkbox of listbox listcell

asked 2016-10-17 21:27:52 +0800

scottz
1

We've got a grouped grid/listbox and I'm attempting to add a checkbox to each group that will select/deselect all members of that group (ideally I will also uncheck the group's checkbox if the user unsets the checkbox of a group member after selecting the group checkbox). There's probably an easier way to set this up, and if there is, I'd love to hear it. I've been able to navigate through the element tree and find out if a listitem is checkable, but I've not been able to find anything that will let me set the check state of a listitem in a listbox that is selectable.

The main question I have is: is there a way to navigate through the below structure through an oncheck method for the group checkbox that will let me set/unset the checked status of the listitems.

The .zul is below:

        <grid model="@bind(vm.groupList)"
vflex="1"
mold="paging"
emptyMessage="No groups"
autopaging="false" >
<rows>
<template name="model" var="item">
<row onDoubleClick="@command('edit', messageGroup = item)" onClick="@command('selectItem',messageGroup=item, target=self)">
<checkbox id="@load(item.groupId)" label="@load(item.groupName)" onCheck="@command('selectGroup', checkBox=self, group=item.groupName)" />
<detail onOpen="" onDoubleClick="">
multiple="true"
checkmark="true"
selectedItems="@bind(vm.selectedUsers)"
nonselectableTags="*">
<template name="model" >
<listitem>
</listitem>
</template>
<listfoot>
<listfooter label="Total: " align="left">
</listfooter>
</listfoot>
</listbox>
</detail>
</row>
</template>
</rows>
</grid>

delete retag edit
Be the first one to answer this question!
[hide preview]

## Stats

Asked: 2016-10-17 21:27:52 +0800

Seen: 28 times

Last updated: Oct 17 '16

Support Options
• Email Support
• Training
• Consulting
• Outsourcing