List group

asked 2014-11-27 10:59:56 +0800

wigberto gravatar image wigberto
52 4

I am testing 'list group' example of zk live demo and I wonder if there is any way to show the data with "list group" closed.

<div apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('demo.listbox.list_group.ListGroupViewModel')">
    <listbox model="@load(vm.groupModel)" height="400px" checkmark="true"
        onSelect="@command('selectGroup', data=event.reference.value)" multiple="true"
        <!-- Make Grouping item selectable-->
        <custom-attributes org.zkoss.zul.listbox.groupSelect="true" />
            <listheader width="160px" sort="auto(Category)" label="Category" />
            <listheader width="140px" sort="auto(Name)" label="Name" />
            <listheader hflex="1" sort="auto(TopNutrients)" label="Top Nutrients" />
            <listheader hflex="1" align="center" sort="auto(DailyPercent)" label="% of Daily" />
            <listheader hflex="1" align="center" sort="auto(Calories)" label="Calories" />
            <listheader width="140px" sort="auto(Quantity)" label="Quantity" />        

Thank you.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-30 11:33:18 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

See this zk example it have already a attribute open="false"

<?xml version="1.0" encoding="UTF-8"?>
    Listbox support Grouping
    <listbox id="listbox" width="250px">
        <listhead sizable="true" id="h">
            <listheader id="h1" label="name" sort="auto" />
            <listheader id="h2" label="gender" sort="auto" />
        <listgroup id="gp1" open="false">
            <listcell label="Group1"/>
            <listcell label="Group2"/>
            <listcell label="a Mary" />
            <listcell label="a FEMALE" />
            <listcell label="b Mary" />
            <listcell label="b FEMALE" />
        <listitem id="li1">
            <listcell label="c Mary1" />
            <listcell label="c FEMALE1" />
            <listcell label="d Mary" />
            <listcell label="d FEMALE" />
            <listcell label="e John" />
            <listcell label="e MALE" />
        <listgroup id="g2" label="Grouping 2" />
            <listcell label="Jane" />
            <listcell label="FEMALE" />
            <listcell label="Henry" />
            <listcell label="MALE" />

link publish delete flag offensive edit


Thank you sjoshi, but my problem is when I try to do as in the "demo zk" but there not listgroup in .zul

wigberto ( 2014-12-01 10:06:20 +0800 )edit

Then you have to show java code what exactly you are doing there

sjoshi ( 2014-12-04 07:05:59 +0800 )edit
Your answer
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: 2014-11-27 10:59:56 +0800

Seen: 45 times

Last updated: Nov 30 '14

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