javascrollzkfrozen-columns

ZK: Grid with first column frozen


I have a grid with 7 columns and some rows. Every column has a fixed width (300px), so there is an horizontal scroll. I need to lock first column so that this column is excluded from scroll. In other words, I would like to start scroll from second column.

I know there is "frozen" functionality to do that but it doesn't work. When I do scroll, all columns scroll.

Can you help me? Thanks in advance.

This is my code:

<grid id="listGiorno" mold="default" vflex="1" width="3000px">
                    <frozen columns="1"></frozen>
                    <columns id="columnsGiorno">
                        <column label="Operatore 1" width="300px" sort="none" align="center" />
                        <column label="Operatore 2" width="300px" sort="none" align="center"/>
                        <column label="Operatore 3" width="300px" sort="none" align="center"/>
                        <column label="Operatore 4" width="300px" sort="none" align="center"/>
                        <column label="Operatore 5" width="300px" sort="none" align="center"/>
                        <column label="Operatore 6" width="300px" sort="none" align="center"/>
                        <column label="Operatore 7" width="300px" sort="none" align="center"/>
                    </columns>
                    <rows>
                        <row>
                            <cell><label value="Item 1.1"/></cell>
                            <cell><label value="Item 1.2"/></cell>
                            <cell><label value="Item 1.3"/></cell>
                            <cell><label value="Item 1.4"/></cell>
                            <cell><label value="Item 1.5"/></cell>
                            <cell><label value="Item 1.6"/></cell>
                            <cell><label value="Item 1.7"/></cell>
                        </row>
                        <row>
                            <cell><label value="Item 1.1"/></cell>
                            <cell><label value="Item 1.2"/></cell>
                            <cell><label value="Item 1.3"/></cell>
                            <cell><label value="Item 1.4"/></cell>
                            <cell><label value="Item 1.5"/></cell>
                            <cell><label value="Item 1.6"/></cell>
                            <cell><label value="Item 1.7"/></cell>
                        </row>
                    </rows>
                </grid> ```

Solution

  • Posted a solution for this structure on your other post at: https://forum.zkoss.org/question/114033/grid-with-first-column-frozen/