Freeze Rows and Columns"
From Documentation
m (correct highlight (via JWB)) |
|||
Line 5: | Line 5: | ||
{{ZSS EE}} | {{ZSS EE}} | ||
− | Freeze rows or columns is useful when displaying lots of data. < | + | Freeze rows or columns is useful when displaying lots of data. <code>Range</code> allows you to freeze rows and columns easily like: |
<source lang='java'> | <source lang='java'> | ||
Line 15: | Line 15: | ||
</source> | </source> | ||
− | This method accepts row and column number starting from 1 as a parameter. Calling these methods will take effect on the sheet that < | + | This method accepts row and column number starting from 1 as a parameter. Calling these methods will take effect on the sheet that <code>Range</code> represents only. Passing <code>0</code> means to unfreeze it. |
Line 24: | Line 24: | ||
The code is like: | The code is like: | ||
− | <source lang='java' | + | <source lang='java' highlight='9, 14'> |
public class FreezeComposer extends SelectorComposer<Component> { | public class FreezeComposer extends SelectorComposer<Component> { | ||
Latest revision as of 12:52, 19 January 2022
Available in ZK Spreadsheet EE only
Freeze rows or columns is useful when displaying lots of data. Range
allows you to freeze rows and columns easily like:
//freeze first row and first column
range.setFreezePanel(1,1);
//unfreeze
range.setFreezePanel(0, 0);
This method accepts row and column number starting from 1 as a parameter. Calling these methods will take effect on the sheet that Range
represents only. Passing 0
means to unfreeze it.
The screenshot below is the example application to demonstrate the API usage. If we click "Freeze" button, it will freeze row and column according to current selection.
The code is like:
public class FreezeComposer extends SelectorComposer<Component> {
@Wire
private Spreadsheet ss;
@Listen("onClick = #freezeButton")
public void freeze() {
Ranges.range(ss.getSelectedSheet())
.setFreezePanel(ss.getSelection().getRow(), ss.getSelection().getColumn());
}
@Listen("onClick = #unfreezeButton")
public void unfreeze() {
Ranges.range(ss.getSelectedSheet()).setFreezePanel(0,0);
}
}
All source code listed in this book is at Github.