MVC :Grid regrouping rows

asked 2014-06-11 10:23:36 +0800

elmetni gravatar image elmetni
145 7

hello everyone

i m working on a ZK project what i need to do is create a Grid with a regrouping model , but i want to create my groups manualy , and get rows for each group using a model ,

here what i tried to do so far but it not seems to work

here what i got :

and here what i want to get :

here is my view

<window apply="test.FruitProvider">
    <grid id="mygrid">
            <column label="this is a title"> </column>


         <group label="myGroup1"    />
          <template name="model">

            <label  value="${each}"></label>
        <group label="myGroup2"    />
          <template name="model">
            <label  value="${each}"></label>
        <group label="myGroup3"    />
          <template name="model">
            <label  value="${each}"></label>

and here is my controler

public class FruitProvider extends  org.zkoss.zk.ui.select.SelectorComposer<Window>{

    Grid  mygrid;
    ListModelArray<String> fruit=new ListModelArray(
            new String[] {
                    "Mango"    });; 
    public void doAfterCompose(Window comp) throws Exception {      

can you help me pls?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-06-11 23:06:08 +0800

mhj gravatar image mhj flag of Brazil
806 1 7

Hello elmetni, have you seen this link? grouping_model maybe that can help you...

link publish delete flag offensive edit


ya i did but in my case i have to create groups manualy

elmetni ( 2014-06-12 12:25:51 +0800 )edit

the grouping model is the way to go as mhj said. If you use <template name="model"> that will replace all manually added children including groups. And only one template will be used - you cannot have 3 with the same name (not sure if the last or the first one wins).

cor3000 ( 2014-06-13 05:13:51 +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




Asked: 2014-06-11 10:23:36 +0800

Seen: 32 times

Last updated: Aug 30 '16

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