In some cases, for convenience, user wishes to freeze both columns and rows. To freeze specific columns, you can simply use ZK Frozen component to specify the number of columns you wish to freeze, however, Frozen component does not support row freeze. In this blog, I will show you how you can freeze not only columns but also rows. I have here combined 4 grid components into a composite component, the frozenGrid component to represent the freeze effect. With this technique you can now freeze both columns and rows for more flexibility and friendlier user experience.
Below is what a FrozenGrid would look like
Following are the tips on how you can use this frozenGrid:
1. Place desired column and row component in the frozenGrid component:
Similar to the Grid component, you can place Columns component in the “columns” template, and Rows component in the “rows” template.
You can place any component in the “toolbar” template such as a label or a menu to customize this area.
3. Set a model and rowRenderer in frozenGrid:
4. Set a model and render using a model template in frozenGrid:
5. ZK bind is not supported yet, but you can use EL to render the Template instead:
I hope you find this frozenGrid component useful. Note that this component requires ZK 6+ so if you are using ZK 5 you will need to first upgrade your project to ZK 6.