How to set checked of checkbox of listbox listcell

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

scottz gravatar image scottz

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)"
              emptyMessage="No groups"
              autopaging="false" >
                <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="">
                            <listbox model="@load(vm.getGroupUsers(item))" 
                                <template name="model" >
                                        <listcell label="@load(vm.getPartyFullNameWithRank(each.user.party))" />
                                    <listfooter label="Total: " align="left">
                                        <label value="@load(vm.reload(item).messageGroupUsers.size())" style="font-weight:bold"/>
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



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

Seen: 34 times

Last updated: Oct 17 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More