サポート&サービス

Home > サポート&サービス > テクニカルサポート > ナレッジベース

テクニカルサポート

製品に関する技術的なサービスを提供しています。製品別の技術情報(ナレッジベース)および、対応環境情報をご覧いただけます。また、E-mailによるテクニカルサポートのお申し込みもこちらで受け付けています。

ナレッジベース

ImNumber型セルで数値の符号を切り替えると、値が 0 になり文字列の選択状態が解除される
文書番号 : 31989     文書種別 : Bug
登録日 : 2012/02/22     最終更新日 : 2012/03/06
文書を印刷する
対象製品
MultiRow for ASP.NET 1.0J
ステータス
回避方法あり
詳細
セルが編集状態で文字列が選択されている時に [+]または[-]キーを押下して数値の符号を変更すると、数値が 0 になり、文字列の選択状態が解除されます。

ImNumber型セルでは、[+]または[-]キーは符号の切り替えを行います。よって、文字列が選択されている状態でこれらのキーを押下されたときの正しい動作は、文字列の選択状態は維持され数値の絶対値は変化せず、符号だけが切り替わります。

<例>
1. 値 100 が設定されたセルを編集モードにし、文字列「100」を選択状態(ハイライト表示)にします。
2. [-]キーを押下すると数値が 0 になり、文字列の選択状態は解除されます。

正しくは、「-100」という数値で「100」が選択状態になります。
回避方法
以下の回避スクリプトHookImNumberUIProcessMethods()をページのonloadイベントで呼び出すことで回避できます。

[JavaScript]
<head runat="server">
    <script language="javascript" type="text/javascript">
    
        function HookImNumberUIProcessMethods() {
            if (ImNumberUIProcess != null && ImNumberUIProcess.prototype.SetFix != null) {
                ImNumberUIProcess.prototype.__oldSetFix = ImNumberUIProcess.prototype.SetFix;
                ImNumberUIProcess.prototype.SetFix = ImNumberUIProcessSetFixWrapper;
            }
            if (ImNumberUIProcess != null && ImNumberUIProcess.prototype.KeyDown != null) {
                ImNumberUIProcess.prototype.__oldKeyDown = ImNumberUIProcess.prototype.KeyDown;
                ImNumberUIProcess.prototype.KeyDown = ImNumberUIProcessKeyDownWrapper;
            }
        }

        function ImNumberUIProcessSetFixWrapper(start, length, sign) {
            var result = ImNumberUIProcess.prototype.__oldSetFix.call(this, start, length, sign);

            if (ImNumberUIProcess.__hasSelection) {
                result.SelectionEnd = this.ShowText().length - result.SelectionStart + 1;
            }

            return result;
        }
        
        function ImNumberUIProcessKeyDownWrapper(data) {
            if (data.KeyCode == 109 || data.KeyCode == 189 || data.KeyCode == 65723 || data.KeyCode == 107) {
                if (data.SelectionEnd - data.SelectionStart > 0) {
                    ImNumberUIProcess.__hasSelection = true;
                    data.SelectionEnd = data.SelectionStart;
                }
            }
            var result = ImNumberUIProcess.prototype.__oldKeyDown.call(this, data);
            if (ImNumberUIProcess.__hasSelection) {
                ImNumberUIProcess.__hasSelection = undefined;
            }

            return result;
        }
    </script>
</head>
<body onload="HookImNumberUIProcessMethods()">
キーワード
MRAP08689

この情報は、疑問・問題解決のお役に立ちましたか?

    


こちらに入力されたご質問には回答できませんので、製品に関するお問い合わせは、別途「E-mailサポート」をご利用ください。


※ 個人情報保護のため、個人情報の記入はご遠慮ください。

このページの先頭へ