Freeze Rows and Columns"

From Documentation
m
Line 40: Line 40:
 
</source>
 
</source>
  
===Open cell menu===
+
===Composer===
 +
====Open cell menu====
 
<source lang="java" high="4">
 
<source lang="java" high="4">
 
Spreadsheet spreadsheet;
 
Spreadsheet spreadsheet;
Line 50: Line 51:
  
 
[[File:ZKSsEss_Spreadsheet_FreeHeader_Row.png]]
 
[[File:ZKSsEss_Spreadsheet_FreeHeader_Row.png]]
===Freeze row / column===
+
====Freeze row / column====
 
<source lang="java" high="3,8">
 
<source lang="java" high="3,8">
 
public void onFreezeRow(ForwardEvent event) {
 
public void onFreezeRow(ForwardEvent event) {
Line 65: Line 66:
 
[[File:ZKSsEss_Spreadsheet_FreezeHeader_Result.png]]
 
[[File:ZKSsEss_Spreadsheet_FreezeHeader_Result.png]]
  
===Unfreeze row /column===
+
====Unfreeze row /column====
 
<source lang="java" high="3,8">
 
<source lang="java" high="3,8">
 
Menuitem unfreezeRows;
 
Menuitem unfreezeRows;
Line 79: Line 80:
 
[[File:ZKSsEss_Spreadsheet_FreezeHeader_Unfreeze.png]]
 
[[File:ZKSsEss_Spreadsheet_FreezeHeader_Unfreeze.png]]
  
Unfreeze result
+
Unfreeze result<br/>
 
[[File:ZKSsEss_Spreadsheet_FreezeHeader_UnfreezeResult.png]]
 
[[File:ZKSsEss_Spreadsheet_FreezeHeader_UnfreezeResult.png]]
  

Revision as of 09:30, 22 November 2010


Purpose

ZK Spreadsheet can freeze row or column use Spreadsheet.setRowfreeze(Integer) or Spreadsheet.setColumnfreeze(Integer).

ZUML

<zk>
	<div height="100%" width="100%" apply="demo.FreezeComposer">
		<div height="3px"></div>
		<spreadsheet id="spreadsheet" src="/demo_sample.xls"	
			maxrows="200" 
			maxcolumns="40"
			width="100%"
			height="450px"></spreadsheet>
		<menupopup id="cellMenu">
			<menu label="Freeze Row">
				<menupopup>
					<menuitem id="unfreezeRows" label="Unfreeze all rows" />
					<menuseparator />
					<menuitem label="Freeze Row 1" forward="onFreezeRow(0)"/>
					<menuitem label="Freeze Row 2" forward="onFreezeRow(1)"/>
					<menuitem label="Freeze Row 3" forward="onFreezeRow(2)"/>
				</menupopup>
			</menu>
			<menu label="Freeze Col">
				<menupopup>
					<menuitem id="unfreezeCols" label="Unfreeze all cols" />
					<menuseparator />
					<menuitem label="Freeze Col 1" forward="onFreezeCol(0)"/>
					<menuitem label="Freeze Col 2" forward="onFreezeCol(1)"/>
					<menuitem label="Freeze Col 3" forward="onFreezeCol(2)"/>
				</menupopup>
			</menu>
		</menupopup>
	</div>
</zk>

Composer

Open cell menu

Spreadsheet spreadsheet;
Menupopup cellMenu;
public void onCellRightClick$spreadsheet(CellMouseEvent event) {
	cellMenu.open(event.getPageX(), event.getPageY());
}

ZKSsEss Spreadsheet FreeHeader Row.png

Freeze row / column

public void onFreezeRow(ForwardEvent event) {
	int row = Integer.parseInt((String)event.getData());
	spreadsheet.setRowfreeze(row);
}
	
public void onFreezeCol(ForwardEvent event) {
	int col = Integer.parseInt((String)event.getData());
	spreadsheet.setColumnfreeze(col);
}

ZKSsEss Spreadsheet FreezeHeader Result.png

Unfreeze row /column

Menuitem unfreezeRows;
public void onClick$unfreezeRows() {
	spreadsheet.setRowfreeze(-1);
}
	
Menuitem unfreezeCols;
public void onClick$unfreezeCols() {
	spreadsheet.setColumnfreeze(-1);
}

ZKSsEss Spreadsheet FreezeHeader Unfreeze.png

Unfreeze result
ZKSsEss Spreadsheet FreezeHeader UnfreezeResult.png

Version History

Last Update : 2010/11/22


Version Date Content
     


All source code listed in this book is at Github.


Last Update : 2010/11/22

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.