Configuration

Specifying the library properties below in zk.xml to configure spreadsheet’s behaviors. There are other properties supported by underlying ZK framework, please refer to ZK Configuration Reference.

Scope

You can configure a property to apply at various scopes, please read The Library Properties.

Formula Cache

Importing

Default: false

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>

Set the property to true and Keikai will import formula cache of an Excel file and it can reduce the file loading time because Keikai doesn’t need to re-evaluate formulas at loading.

<library-property>
    <name>io.keikai.import.cache</name>
    <value>true</value>
</library-property>

Few points need to be noticed:

  1. If some functions not yet supported by Keikai spreadsheet are used in a formula, re-evaluation breaks the cached value even if precedent cells do not change.
  2. If you use a customized function only supported in Keikai spreadsheet in a formula, the cached result is always #NAME! error. Application developers must enforce re-evaluation by Range.refresh(true, true, true).

Exporting

Default value: false

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>

Set the property to true and Keikai will export the formula cache into an Excel file.

<library-property>
    <name>io.keikai.export.cache</name>
    <value>true</value> 
</library-property>

Keep Cell Selection

Default value: true

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>

If it’s true, when a dialog pops popup (Keikai loses its focus), Keikai still display cell selection box. Because sometimes an end user would like to know which range is selected when he/she is operating on a popup dialog.

If it’s false, then Keikai will hide cell selection.

<library-property>
    <name>io.keikai.ui.keepCellSelection</name>
    <value>false</value>
</library-property>

Add Extra Font Family

since 5.3.0

Default: none

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>

You can add more fonts in font family drop-down of the toolbar by the property:

<library-property>
    <name>io.keikai.ui.Spreadsheet.customFontFamily</name>
    <value>Roboto, Helvetica Neue</value>
</library-property>

Keikai will appends the specified fonts in the drop-down list.

Show a Blank Cell as a Gap or Zero

since 5.3.0

Default: false

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>

When a chart’s data source contains a blank cell, you can configure it to display it as a gap or zero.

<library-property>
    <name>io.keikai.chart.emptyAsGaps</name>
    <value>true</value>
</library-property>

Focus Cell Position

since 5.8.0

Default: bottom

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>

Acceptable values: bottom, top

The position that keikai shows the focused cell when you call Spreadsheet.focusTo(int row, int column).

<library-property>
    <name>io.keikai.focus.cell.position</name>
    <value>top</value>
</library-property>

Iterative Calculation

since 5.8.0

Max Iteration

Set the maximum number times Keikai will recalculate.

Default: 0

No iteration calculation. keikai will show #N/A when there is a circular reference.

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>
<library-property>
  <name>io.keikai.formula.maxIterations</name>
  <value>100</value>
</library-property>

Max Change

Set the maximum amount of change between recalculation results

Default: 0.001

Applicable Scope:
globally in zk.xml via <library-property>
nested in a zul file via <custom-attributes>
<library-property>
  <name>io.keikai.formula.maxChange</name>
  <value>0.5</value>
</library-property>

Consistent Value under Collaboration Edit

since 5.9.0

It’s better to set the same value for all components in the collaboration edit mode when editing the same Book. If multiple keikai components have different max iteration values specified, the later-created keikai will override the previous one. Then each time a user joins to edit a book collaboratively, it overrides the max iteration. Then that value override will make circular references produce different results for each time.

Get code at GitHub

Comments