Sheetbar"

From Documentation
m
m (correct highlight (via JWB))
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:UnderConstruction}}
+
{{ZKSpreadsheetEssentialsPageHeader}}
 +
 
 +
 
 +
{{Deprecated|url=http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials}}
 +
 
  
{{ZKSpreadsheetEssentialsPageHeader}}
 
  
 
__TOC__
 
__TOC__
  
 
===Purpose===
 
===Purpose===
ZK Spreadsheet provide sheetbar for user to perform sheet actions, such as select sheet, add sheet, delete sheet etc...
+
ZK Spreadsheet provides  <b>sheetbar</b> to perform sheet actions such as select sheet, add sheet, delete sheet etc...
  
 
===Show Sheetbar===
 
===Show Sheetbar===
Line 17: Line 20:
 
[[File:ZKSsEss_Spreadsheet_Sheetbar_addSheetButton.png]]
 
[[File:ZKSsEss_Spreadsheet_Sheetbar_addSheetButton.png]]
  
The new sheet name prefix use '''Sheet''', developer could change it by use I18N key '''zss.sheet'''<br/>
+
The new sheet name prefix uses '''Sheet''', this is changable by using I18N key '''zss.sheet'''<br/>
 
[[File:ZKSsEss_Spreadsheet_Sheetbar_addedSheet.png]]
 
[[File:ZKSsEss_Spreadsheet_Sheetbar_addedSheet.png]]
  
 
====I18N====
 
====I18N====
Each button/menuitem map to a key, developer could browser all I18 keys by <javadoc directory="zss"  method="getLabelKeys">org.zkoss.zss.ui.Action</javadoc>
+
Each button/menuitem map to a key, developers can browse all I18 keys by <javadoc directory="zss"  method="getLabelKeys">org.zkoss.zss.ui.Action</javadoc>
  
Here is partial keys for sheetbar
+
Here are the partial keys for the <b>sheetbar</b>
 
{| border="1"
 
{| border="1"
 
|-
 
|-
Line 44: Line 47:
  
 
Refer to sample [http://code.google.com/p/zkbooks/source/browse/trunk/zssessentials/examples/WebContent/WEB-INF/i3-label.properties i3-label.properties]
 
Refer to sample [http://code.google.com/p/zkbooks/source/browse/trunk/zssessentials/examples/WebContent/WEB-INF/i3-label.properties i3-label.properties]
 +
 +
===ZUML===
 +
Here is a sample example ZUL file
 +
 +
<source lang="xml" highlight="4">
 +
<zk>
 +
<window vflex="1" width="100%" apply="org.zkoss.zssessentials.config.SheetbarComposer">
 +
<button id="toggleSheetbar" label="Toggle sheetbar"/>
 +
<spreadsheet showSheetbar="true"
 +
id="spreadsheet" vflex="true" width="100%"
 +
src="/WEB-INF/excel/config/ZSS-demo_sample.xlsx" maxcolumns="40" maxrows="200"
 +
></spreadsheet>
 +
</window>
 +
</zk>
 +
</source>
 +
 +
View complete source of ZUML [https://code.google.com/p/zkbooks/source/browse/trunk/zssessentials/examples/WebContent/config/sheetbar.zul sheetbar.zul]
 +
 +
===Composer===
 +
The composer uses <javadoc directory="zss"  method="setShowSheetbar">org.zkoss.zss.ui.Spreadsheet</javadoc> to show or hide 'sheetbar'.
 +
<source lang="java" highlight="3">
 +
public void onClick$toggleSheetbar() {
 +
boolean toggle = !spreadsheet.isShowSheetbar();
 +
spreadsheet.setShowSheetbar(toggle);
 +
}
 +
</source>
 +
 +
See the full source code for Composer [https://code.google.com/p/zkbooks/source/browse/trunk/zssessentials/examples/src/org/zkoss/zssessentials/config/SheetbarComposer.java here]
  
 
=Version History=
 
=Version History=

Latest revision as of 12:56, 19 January 2022



Stop.png This article is out of date, please refer to http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials for more up to date information.


Purpose

ZK Spreadsheet provides sheetbar to perform sheet actions such as select sheet, add sheet, delete sheet etc...

Show Sheetbar

Use Spreadsheet.setShowSheetbar to show sheetbar.

ZKSsEss Spreadsheet Sheetbar.png

Add Sheet

Click the button to add sheet
ZKSsEss Spreadsheet Sheetbar addSheetButton.png

The new sheet name prefix uses Sheet, this is changable by using I18N key zss.sheet
ZKSsEss Spreadsheet Sheetbar addedSheet.png

I18N

Each button/menuitem map to a key, developers can browse all I18 keys by Action.getLabelKeys

Here are the partial keys for the sheetbar

Action I18 Key
Sheet zss.sheet
Add Sheet zss.addSheet
Delete Sheet zss.deleteSheet
Rename Sheet zss.renameSheet
Move Sheet Left zss.moveSheetLeft
Move Sheet Right zss.moveSheetRight
Protect Sheet zss.protectSheet

Refer to sample i3-label.properties

ZUML

Here is a sample example ZUL file

<zk>
	<window vflex="1" width="100%" apply="org.zkoss.zssessentials.config.SheetbarComposer">
		<button id="toggleSheetbar" label="Toggle sheetbar"/>
		<spreadsheet showSheetbar="true"
			id="spreadsheet" vflex="true" width="100%"
			src="/WEB-INF/excel/config/ZSS-demo_sample.xlsx" maxcolumns="40" maxrows="200"
			></spreadsheet>
	</window>
</zk>

View complete source of ZUML sheetbar.zul

Composer

The composer uses Spreadsheet.setShowSheetbar to show or hide 'sheetbar'.

	public void onClick$toggleSheetbar() {
		boolean toggle = !spreadsheet.isShowSheetbar();
		spreadsheet.setShowSheetbar(toggle);
	}

See the full source code for Composer here

Version History

Last Update : 2022/01/19


Version Date Content
2.3.0 April, 2012 Sheetbar
     


All source code listed in this book is at Github.

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