0

KeiKai Spreadsheet zoom exception

asked 2023-09-12 15:27:12 +0800

AlfredCheng gravatar image AlfredCheng
3 1

zk version: 9.6.2 keikai version: keikai-oss 5.0.0

Browser zoom with 125%, enter something in the spreadsheet. Following exception throw: java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap') at io.keikai.ui.au.in.TextHeightCommand.process(TextHeightCommand.java:58) at io.keikai.ui.Spreadsheet.service(Spreadsheet.java:6154) ...

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-09-14 12:58:53 +0800

hawk gravatar image hawk
3205 1 5
http://hawkphoenix.blogsp... ZK Team

It's caused by a browser sends a height in double for 90% zoom level when sending onZSSTextHeight event to a server. You can override js to fix it.

/**
 * Purpose: convert a double (height) to an integer
 * Based on version: 5.0.0
 */
zk.afterLoad('zss', function() {
    var exWidget = {};
    zk.override(zss.SSheetCtrl.prototype, exWidget, {
        _sendOnTextHeight: function (row, col, height) {
            var wgt = this._wgt;
            height = Math.floor(height);
            wgt.fire('onZSSTextHeight', {sheetId: this.serverSheetId, row: row, col : col, height: height}, {toServer: true});
        },
    });

});

https://www.zkoss.org/wiki/ZKDeveloper%27sReference/HowtogetEfficientSupport#HowtoIncludeaJavaScript_file

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2023-09-12 15:27:12 +0800

Seen: 3 times

Last updated: Sep 14 '23

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More