0

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"
        itemRenderer="demo.listbox.list_group.FoodListGroupRenderer">
        <!-- Make Grouping item selectable-->
        <custom-attributes org.zkoss.zul.listbox.groupSelect="true" />
        <listhead>        
            <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" />        
        </listhead>       
    </listbox>
</div>

Thank you.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

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

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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

<?xml version="1.0" encoding="UTF-8"?>
<zk>
    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" />
        </listhead>
        <listgroup id="gp1" open="false">
            <listcell label="Group1"/>
            <listcell label="Group2"/>
        </listgroup>
        <listitem>
            <listcell label="a Mary" />
            <listcell label="a FEMALE" />
        </listitem>
        <listitem>
            <listcell label="b Mary" />
            <listcell label="b FEMALE" />
        </listitem>
        <listitem id="li1">
            <listcell label="c Mary1" />
            <listcell label="c FEMALE1" />
        </listitem>
        <listitem>
            <listcell label="d Mary" />
            <listcell label="d FEMALE" />
        </listitem>
        <listitem>
            <listcell label="e John" />
            <listcell label="e MALE" />
        </listitem>
        <listgroup id="g2" label="Grouping 2" />
        <listitem>
            <listcell label="Jane" />
            <listcell label="FEMALE" />
        </listitem>
        <listitem>
            <listcell label="Henry" />
            <listcell label="MALE" />
        </listitem>

    </listbox>
</zk>
link publish delete flag offensive edit

Comments

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

Follow
1 follower

RSS

Stats

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

Seen: 41 times

Last updated: Nov 30 '14

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