0

Grid Cells Bind

asked 2016-10-28 01:23:48 +0800

psinalberth gravatar image psinalberth
52 6

Hi,

I'd like to know if it's possible to bind a collection of objects for each different cell on a grid, instead of binding each row of it:

I have this grid (one object per row):

<grid model="@load(objects)">
    <columns>
      <column label="Person"/>
      <column label="Person"/>
    </columns>
    <rows>
       <template name="model" var="obj">
          <row value="@bind(obj)">
            <label value="@load(obj.name)"/> <!-- John Doe -->
            <label value="@load(obj.name)"/> <!-- Jane Doe -->
            ...
          </row>
       </template>
    </rows>
</grid>

I'm looking for something like (as many as possible):

<grid model="@load(objects)">
    <columns>
       <column label="Person">
       <column label="Person">
    </columns>
    <rows>
       <template name="model" var="obj">
          <row>
            <label value="@load(obj.name)"/> <!-- John Doe --> <!-- Jane Doe -->
            <label value="@load(obj.name)"/>

... </row> </template> </rows> </grid>

delete flag offensive retag edit

Comments

Difficult to answer but I'm thinking you need to search for children attribute.

chillworld ( 2016-10-28 06:41:32 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-10-30 08:06:53 +0800

Darksu gravatar image Darksu
1991 1 4

Hello psinalberth,

You could use a RowRenderer as shown below:

https://www.zkoss.org/zkdemo/grid/dynamic_renderer

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2016-11-07 01:03:36 +0800

psinalberth gravatar image psinalberth
52 6

Thanks Darksu I'll try later. At the moment I'm using a wire grid, so I'm appending the objects by grid.getCell(row, column).appendChild(myComponent).

link publish delete flag offensive 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: 2016-10-28 01:23:48 +0800

Seen: 34 times

Last updated: Nov 07 '16

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